-
Notifications
You must be signed in to change notification settings - Fork 2.9k
chore(react-avatar): Adding unit and vr tests for AvatarGroup #23549
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
Merged
sopranopillow
merged 24 commits into
microsoft:master
from
sopranopillow:avatargroup-tests
Jun 28, 2022
Merged
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
3a44a6c
adding testing to AvatarGroup
sopranopillow 88a1d6e
restore badge api file
sopranopillow c352c71
change fileS
sopranopillow 24dd476
reverting api file
sopranopillow 4e95874
fixing interactive story in vr-tests
sopranopillow 71002e5
fixing cropping of interactive story
sopranopillow eee2ddc
possible border radius fix
sopranopillow c870975
Merge branch 'master' of https://github.com/microsoft/fluentui into a…
sopranopillow 63f5ace
removing unnecessary div
sopranopillow 4e116a6
reverting changes
sopranopillow a778010
possible fix
sopranopillow 2b19bdb
sync
sopranopillow 6742709
reverting files to deal with issue in another PR
sopranopillow 9956bd3
Update change/@fluentui-react-avatar-0ebe3e03-9d8f-48f7-a4c0-2a95b701…
sopranopillow 9b4bd3f
Update apps/vr-tests-react-components/src/stories/AvatarGroup.stories…
sopranopillow 233ae01
Update packages/react-components/react-avatar/src/components/AvatarGr…
sopranopillow 0491379
Merge branch 'master' of https://github.com/microsoft/fluentui into a…
sopranopillow b093681
Merge branch 'avatargroup-tests' of https://github.com/sopranopillow/…
sopranopillow d8e1a19
covering stack and pie for rtl+HCM+dark mode
sopranopillow 7a64e8b
updating vr-tests
sopranopillow 985a2f1
Merge branch 'master' of https://github.com/microsoft/fluentui into a…
sopranopillow 563c3ba
updating classname tests for AvatarGroup
sopranopillow 8cad6e4
adding color to diviers
sopranopillow d819130
Merge branch 'master' of https://github.com/microsoft/fluentui into a…
sopranopillow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
91 changes: 91 additions & 0 deletions
91
apps/vr-tests-react-components/src/stories/AvatarGroup.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| import * as React from 'react'; | ||
| import { storiesOf } from '@storybook/react'; | ||
| import Screener from 'screener-storybook/src/screener'; | ||
| import { AvatarGroup, AvatarGroupItem, AvatarGroupProps } from '@fluentui/react-avatar'; | ||
| import { TestWrapperDecorator } from '../utilities/TestWrapperDecorator'; | ||
|
|
||
| const names = [ | ||
| 'Katri Athokas', | ||
| 'Elvia Atkins', | ||
| 'Mauricio August', | ||
| 'Colin Ballinger', | ||
| 'Lydia Bauer', | ||
| 'Amanda Brady', | ||
| 'Henry Brill', | ||
| 'Celeste Burton', | ||
| 'Robin Counts', | ||
| 'Tim Deboer', | ||
| 'Cameron Evans', | ||
| 'Isaac Fielder', | ||
| 'Cecil Folk', | ||
| 'Miguel Garcia', | ||
| 'Wanda Howard', | ||
| 'Mona Kane', | ||
| 'Kat Larsson', | ||
| 'Ashley McCarthy', | ||
| 'Johnie McConnell', | ||
| 'Allan Munger', | ||
| 'Erik Nason', | ||
| 'Kristin Patterson', | ||
| 'Daisy Phillips', | ||
| 'Carole Poland', | ||
| 'Carlos Slattery', | ||
| 'Robert Tolbert', | ||
| 'Kevin Sturgis', | ||
| 'Charlotte Waltson', | ||
| 'Elliot Woodward', | ||
| ]; | ||
|
|
||
| const sizes = [16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 96, 120, 128]; | ||
|
|
||
| const AvatarGroupList: React.FC<AvatarGroupProps> = props => { | ||
| return ( | ||
| <div style={{ display: 'flex', flexDirection: 'column', flexWrap: 'wrap', gap: '10px' }}> | ||
| {sizes.map(size => ( | ||
| <AvatarGroup key={size} size={size as AvatarGroupProps['size']} {...props}> | ||
| {names.map(name => ( | ||
| <AvatarGroupItem key={name} name={name} /> | ||
| ))} | ||
| </AvatarGroup> | ||
| ))} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| // Non-interactive stories | ||
| storiesOf('AvatarGroup Converged', module) | ||
| .addDecorator(TestWrapperDecorator) | ||
| .addDecorator(story => ( | ||
| <Screener steps={new Screener.Steps().snapshot('default', { cropTo: '.testWrapper' }).end()}>{story()}</Screener> | ||
| )) | ||
| .addStory('basic', () => <AvatarGroupList />, { | ||
| includeRtl: true, | ||
| includeHighContrast: true, | ||
| includeDarkMode: true, | ||
| }) | ||
| .addStory('layoutPie', () => <AvatarGroupList layout="pie" />) | ||
| .addStory('layoutStack', () => <AvatarGroupList layout="stack" />) | ||
| .addStory('overflowIndicator', () => <AvatarGroupList overflowIndicator="icon" />); | ||
|
|
||
| // Interactive stories | ||
| storiesOf('AvatarGroup Converged', module) | ||
| .addDecorator(TestWrapperDecorator) | ||
| .addDecorator(story => ( | ||
| <Screener steps={new Screener.Steps().click('#show-overflow').snapshot('overflowConentOpen').end()}> | ||
| {story()} | ||
| </Screener> | ||
| )) | ||
| .addStory( | ||
| 'overflowContent', | ||
| () => ( | ||
| <AvatarGroup overflowButton={{ id: 'show-overflow' }}> | ||
| {names.map(name => ( | ||
| <AvatarGroupItem key={name} name={name} /> | ||
| ))} | ||
| </AvatarGroup> | ||
| ), | ||
| { | ||
| includeHighContrast: true, | ||
| includeDarkMode: true, | ||
| }, | ||
| ); | ||
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-avatar-0ebe3e03-9d8f-48f7-a4c0-2a95b7014e2e.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "chore: Adding unit tests for AvatarGroup. ", | ||
| "packageName": "@fluentui/react-avatar", | ||
| "email": "esteban.230@hotmail.com", | ||
| "dependentChangeType": "patch" | ||
| } | ||
|
sopranopillow marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 0 additions & 87 deletions
87
...omponents/react-avatar/src/components/AvatarGroup/__snapshots__/AvatarGroup.test.tsx.snap
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.