forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added VR tests for Breadcrumb (microsoft#28653)
* Added Breadcrumb stories to the folder. * Added VR tests for the Breadcrumb
- Loading branch information
1 parent
9250428
commit 58c60bc
Showing
9 changed files
with
140 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
69 changes: 69 additions & 0 deletions
69
apps/vr-tests-react-components/src/stories/Breadcrumb/Breadcrumb.stories.tsx
This file contains 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,69 @@ | ||
import * as React from 'react'; | ||
import { Breadcrumb } from '@fluentui/react-breadcrumb-preview'; | ||
import { SampleBreadcrumbButtons, SampleBreadcrumbLinks, SampleBreadcrumbItems, steps } from './utils'; | ||
import { ComponentMeta } from '@storybook/react'; | ||
import { getStoryVariant, DARK_MODE, HIGH_CONTRAST, RTL, withStoryWrightSteps } from '../../utilities'; | ||
|
||
export default { | ||
title: 'Breadcrumb Converged', | ||
decorators: [story => withStoryWrightSteps({ story, steps })], | ||
} as ComponentMeta<typeof Breadcrumb>; | ||
|
||
export const Appearance = () => ( | ||
<> | ||
<h1>BreadcrumbButton</h1> | ||
<h2>Transparent</h2> | ||
<SampleBreadcrumbButtons appearance="transparent" /> | ||
<h2>Subtle</h2> | ||
<SampleBreadcrumbButtons appearance="subtle" /> | ||
|
||
<h1>BreadcrumbLink</h1> | ||
<h2>Transparent</h2> | ||
<SampleBreadcrumbLinks appearance="transparent" /> | ||
<h2>Subtle</h2> | ||
<SampleBreadcrumbLinks appearance="subtle" /> | ||
</> | ||
); | ||
|
||
Appearance.storyName = 'appearance'; | ||
|
||
export const AppearanceDarkMode = getStoryVariant(Appearance, DARK_MODE); | ||
export const AppearanceHighContrast = getStoryVariant(Appearance, HIGH_CONTRAST); | ||
export const AppearanceRTL = getStoryVariant(Appearance, RTL); | ||
|
||
export const Size = () => ( | ||
<> | ||
<h1>BreadcrumbButton</h1> | ||
<SampleBreadcrumbButtons size="small" /> | ||
<SampleBreadcrumbButtons size="medium" /> | ||
<SampleBreadcrumbButtons size="large" /> | ||
|
||
<h1>BreadcrumbLink</h1> | ||
<SampleBreadcrumbLinks size="small" /> | ||
<SampleBreadcrumbLinks size="medium" /> | ||
<SampleBreadcrumbLinks size="large" /> | ||
|
||
<h1>BreadcrumbItem</h1> | ||
<SampleBreadcrumbItems size="small" /> | ||
<SampleBreadcrumbItems size="medium" /> | ||
<SampleBreadcrumbItems size="large" /> | ||
</> | ||
); | ||
|
||
Size.storyName = 'size'; | ||
|
||
export const DividerType = () => ( | ||
<> | ||
<h1>BreadcrumbButton</h1> | ||
<SampleBreadcrumbButtons dividerType="chevron" /> | ||
|
||
<h1>BreadcrumbLink</h1> | ||
<SampleBreadcrumbLinks dividerType="chevron" /> | ||
|
||
<h1>BreadcrumbItem</h1> | ||
<SampleBreadcrumbItems dividerType="slash" size="small" /> | ||
<SampleBreadcrumbItems dividerType="chevron" /> | ||
</> | ||
); | ||
|
||
DividerType.storyName = 'divider type'; |
64 changes: 64 additions & 0 deletions
64
apps/vr-tests-react-components/src/stories/Breadcrumb/utils.tsx
This file contains 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,64 @@ | ||
import * as React from 'react'; | ||
import { Steps } from 'storywright'; | ||
import { | ||
Breadcrumb, | ||
BreadcrumbButton, | ||
BreadcrumbProps, | ||
BreadcrumbItem, | ||
BreadcrumbLink, | ||
BreadcrumbDivider, | ||
} from '@fluentui/react-breadcrumb-preview'; | ||
import { bundleIcon, CalendarMonth20Filled, CalendarMonth20Regular } from '@fluentui/react-icons'; | ||
const CalendarMonth = bundleIcon(CalendarMonth20Filled, CalendarMonth20Regular); | ||
|
||
export const steps = new Steps() | ||
.snapshot('default', { cropTo: '.testWrapper' }) | ||
.hover('.breadcrumb-sample') | ||
.snapshot('hover', { cropTo: '.testWrapper' }) | ||
.mouseDown('.breadcrumb-sample') | ||
.snapshot('pressed', { cropTo: '.testWrapper' }) | ||
.focus('.breadcrumb-sample') | ||
.snapshot('focused', { cropTo: '.testWrapper' }) | ||
.end(); | ||
|
||
export const SampleBreadcrumbButtons = (props: BreadcrumbProps) => ( | ||
<Breadcrumb {...props} className="breadcrumb-sample"> | ||
<BreadcrumbItem> | ||
<BreadcrumbButton icon={<CalendarMonth />}>Item 1</BreadcrumbButton> | ||
</BreadcrumbItem> | ||
<BreadcrumbDivider /> | ||
<BreadcrumbItem> | ||
<BreadcrumbButton disabled>Item 2</BreadcrumbButton> | ||
</BreadcrumbItem> | ||
<BreadcrumbDivider /> | ||
<BreadcrumbItem> | ||
<BreadcrumbButton current>Item 3</BreadcrumbButton> | ||
</BreadcrumbItem> | ||
</Breadcrumb> | ||
); | ||
|
||
export const SampleBreadcrumbLinks = (props: BreadcrumbProps) => ( | ||
<Breadcrumb {...props} className="breadcrumb-sample"> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink icon={<CalendarMonth />}>Item 1</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbDivider /> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink disabled>Item 2</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbDivider /> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink current>Item 3</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
</Breadcrumb> | ||
); | ||
|
||
export const SampleBreadcrumbItems = (props: BreadcrumbProps) => ( | ||
<Breadcrumb {...props} className="breadcrumb-sample"> | ||
<BreadcrumbItem>Item 1</BreadcrumbItem> | ||
<BreadcrumbDivider /> | ||
<BreadcrumbItem>Item 2</BreadcrumbItem> | ||
<BreadcrumbDivider /> | ||
<BreadcrumbItem current>Item 3</BreadcrumbItem> | ||
</Breadcrumb> | ||
); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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