Skip to content
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

Button (v8): convert tests to use testing-library #21966

Conversation

TristanWatanabe
Copy link
Member

Current Behavior

  • v8 Button tests don't use testing-library

New Behavior

  • Convert Button to fully use testing-library

Related Issue(s)

part of #21663

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 4, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ca4a85e:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

fabricteam commented Mar 4, 2022

📊 Bundle size report

🤖 This report was generated against b7f17e976f9e058f39c9fce4f0f9bb6eb4dfa577

@size-auditor
Copy link

size-auditor bot commented Mar 4, 2022

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: b7f17e976f9e058f39c9fce4f0f9bb6eb4dfa577 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Mar 4, 2022

Perf Analysis (@fluentui/react)

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 941 935 5000 Possible regression
BaseButton mount 1013 988 5000 Possible regression
Breadcrumb mount 2385 2398 1000 Possible regression
ButtonNext mount 630 620 5000 Possible regression
Checkbox mount 1430 1452 5000 Possible regression
CheckboxBase mount 1269 1253 5000 Possible regression
ChoiceGroup mount 4180 4108 5000 Possible regression
ComboBox mount 966 951 1000 Possible regression
CommandBar mount 8842 8874 1000 Possible regression
ContextualMenu mount 12807 11389 1000 Possible regression
DefaultButton mount 1129 1157 5000 Possible regression
DetailsRow mount 3282 3291 5000 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 941 935 5000 Possible regression
BaseButton mount 1013 988 5000 Possible regression
Breadcrumb mount 2385 2398 1000 Possible regression
ButtonNext mount 630 620 5000 Possible regression
Checkbox mount 1430 1452 5000 Possible regression
CheckboxBase mount 1269 1253 5000 Possible regression
ChoiceGroup mount 4180 4108 5000 Possible regression
ComboBox mount 966 951 1000 Possible regression
CommandBar mount 8842 8874 1000 Possible regression
ContextualMenu mount 12807 11389 1000 Possible regression
DefaultButton mount 1129 1157 5000 Possible regression
DetailsRow mount 3282 3291 5000 Possible regression
DetailsRowFast mount 3252 3217 5000
DetailsRowNoStyles mount 3061 3074 5000
Dialog mount 2034 1992 1000
DocumentCardTitle mount 342 325 1000
Dropdown mount 2938 2929 5000
FluentProviderNext mount 1806 1809 5000
FluentProviderWithTheme mount 305 289 10
FluentProviderWithTheme virtual-rerender 270 266 10
FluentProviderWithTheme virtual-rerender-with-unmount 336 332 10
FocusTrapZone mount 1691 1694 5000
FocusZone mount 1727 1736 5000
IconButton mount 1588 1583 5000
Label mount 493 517 5000
Layer mount 2743 2723 5000
Link mount 611 600 5000
MakeStyles mount 1709 1709 50000
MenuButton mount 1395 1423 5000
MessageBar mount 2016 1986 5000
Nav mount 2837 2823 1000
OverflowSet mount 1177 1192 5000
Panel mount 1971 1978 1000
Persona mount 907 913 1000
Pivot mount 1303 1292 1000
PrimaryButton mount 1274 1294 5000
Rating mount 6751 6801 5000
SearchBox mount 1316 1301 5000
Shimmer mount 2436 2387 5000
Slider mount 1880 1880 5000
SpinButton mount 4430 4116 5000
Spinner mount 583 584 5000
SplitButton mount 2624 2614 5000
Stack mount 682 651 5000
StackWithIntrinsicChildren mount 2078 2016 5000
StackWithTextChildren mount 4863 4814 5000
SwatchColorPicker mount 9248 9212 5000
TagPicker mount 2155 2102 5000
TeachingBubble mount 71362 71104 5000
Text mount 579 582 5000
TextField mount 1357 1332 5000
ThemeProvider mount 1096 1109 5000
ThemeProvider virtual-rerender 801 793 5000
ThemeProvider virtual-rerender-with-unmount 1593 1598 5000
Toggle mount 882 918 5000
buttonNative mount 281 283 5000

@TristanWatanabe TristanWatanabe marked this pull request as ready for review March 4, 2022 21:51
@TristanWatanabe TristanWatanabe requested review from a team and khmakoto as code owners March 4, 2022 21:51
packages/react/src/components/Button/Button.test.tsx Outdated Show resolved Hide resolved
Comment on lines +758 to +760
const button = getAllByRole('button')[0];
userEvent.click(button);
userEvent.keyboard('{alt}{arrowdown}');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this diff :)

@TristanWatanabe TristanWatanabe merged commit afd0199 into microsoft:master Mar 7, 2022
@TristanWatanabe TristanWatanabe deleted the button-convert-to-testing-library branch March 7, 2022 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants