-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(fluentUI-migration): ActiontButton fluentui v8 to v9 migration #7401
base: fluent-ui-v9-migration-main
Are you sure you want to change the base?
feat(fluentUI-migration): ActiontButton fluentui v8 to v9 migration #7401
Conversation
…osoft/accessibility-insights-web into v-rakesh/actionbutton-migration
…es, format & lint fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a huge effort, well done! I have some questions about things I was confused about and didn't see obvious explanations for.
onClick={this.onClick} | ||
aria-expanded={showContent} | ||
> | ||
{showContent ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to keep the established pattern of calculating values outside of the return
statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @madalynrose agree, moved out of return , please re-review
src/tests/unit/tests/DetailsView/components/details-view-command-bar.test.tsx
Outdated
Show resolved
Hide resolved
@@ -112,7 +112,7 @@ describe('FailureInstancePanelControlTest', () => { | |||
'ActionButton', | |||
'DefaultButton', | |||
]); | |||
useOriginalReactElements('@fluentui/react-components', ['Link', 'Button']); | |||
useOriginalReactElements('@fluentui/react-components', ['Link']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we changing strategy from fully rendering the Button
and using a mocked component instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @madalynrose made changes, please re-review
const userConfigMessageCreatorMock: IMock<UserConfigMessageCreator> = | ||
Mock.ofType(UserConfigMessageCreator); | ||
const assessmentActionMessageCreatorMock: IMock<AssessmentActionMessageCreator> = | ||
Mock.ofType<AssessmentActionMessageCreator>(); | ||
const handleSaveAssesmentButtonClickMock = | ||
Mock.ofType<(event: React.MouseEvent<any>) => void>(); | ||
const userConfigurationStoreData: UserConfigurationStoreData = { | ||
showSaveAssessmentDialog: true, | ||
} as UserConfigurationStoreData; | ||
const propsStub: SaveAssessmentButtonProps = { | ||
deps: { | ||
getAssessmentActionMessageCreator: () => assessmentActionMessageCreatorMock.object, | ||
userConfigMessageCreator: userConfigMessageCreatorMock.object, | ||
}, | ||
download: 'download', | ||
href: 'url', | ||
userConfigurationStoreData, | ||
handleSaveAssesmentButtonClick: handleSaveAssesmentButtonClickMock.object, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this no longer in a beforeEach
block? It's good to make sure all of this stuff is reset before each test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @madalynrose updated and retested, please re-review
@@ -0,0 +1,82 @@ | |||
// Copyright (c) Microsoft Corporation. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there fewer tests than when these tests lived in SaveAssessmentButton
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @madalynrose as we moved out SaveAssessmentDialog from save-assessment-button, hence dialog related tests and save assessment button tests are separated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but it appears that there are fewer total now. I compared across both files.
src/tests/unit/tests/DetailsView/components/start-over-dropdown.test.tsx
Show resolved
Hide resolved
Times.atLeastOnce(), | ||
); | ||
}); | ||
it('dialog is hidden (dismissed) when "got it" button is clicked', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test is missing
}); | ||
|
||
describe('on dialog disabled', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test is missing
fireEvent.click(wrapper.getByRole('link')); | ||
}); | ||
|
||
it('saves assessment without dialog (dialog is hidden)', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test is missing
expect(getMockComponentClassPropsForCall(Dialog).hidden).toEqual(true); | ||
}); | ||
|
||
it('should call saveAssessment on click', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test is missing
Details
Action Button migration from V8 to V9
Styling Improvements:
100%
toauto
for better layout flexibility in multiple snapshot files.normal
for better text consistency.Component Enhancements:
FluentUIV9Icon
import and updated the components to use the new icon.Motivation
Context
UI locations for all the files are mentioned with images in below file:
ActionButtonComparison
Due to FluentUI V9 Migration there are slight differences between old and new Icons. PFA screenshots below.
Note :
Please refer for more information on the error:[Bug]: Tablist - ARIA hidden element must not be focusable or contain focusable elements fluentui#25133
Technical Debt:
These will be take care in up coming PR for v8 to v9 migration.
IButton:
Card footer button scroll behaviour
Closing dialog focus issue
Focus style inconsistency
Pull request checklist
yarn fastpass
yarn test
)<rootDir>/test-results/unit/coverage
fix:
,chore:
,feat(feature-name):
,refactor:
). SeeCONTRIBUTING.md
.