-
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.
- Loading branch information
1 parent
6471229
commit 5eae99c
Showing
7 changed files
with
85 additions
and
84 deletions.
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
src/DateTimeRangePicker/DatePicker/Header/__tests__/Header.test.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
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 |
---|---|---|
@@ -1,41 +1,41 @@ | ||
import React from 'react'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
import React from 'react' | ||
import { ComponentStory, ComponentMeta } from '@storybook/react' | ||
|
||
import { Button } from './Button'; | ||
import { Button } from './Button' | ||
|
||
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export | ||
export default { | ||
const componentMeta: ComponentMeta<typeof Button> = { | ||
title: 'Example/Button', | ||
component: Button, | ||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes | ||
argTypes: { | ||
backgroundColor: { control: 'color' }, | ||
}, | ||
} as ComponentMeta<typeof Button>; | ||
backgroundColor: { control: 'color' } | ||
} | ||
} | ||
export default componentMeta | ||
|
||
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args | ||
const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />; | ||
const Template: ComponentStory<typeof Button> = (args) => <Button {...args} /> | ||
|
||
export const Primary = Template.bind({}); | ||
export const Primary = Template.bind({}) | ||
// More on args: https://storybook.js.org/docs/react/writing-stories/args | ||
Primary.args = { | ||
primary: true, | ||
label: 'Button', | ||
}; | ||
label: 'Button' | ||
} | ||
|
||
export const Secondary = Template.bind({}); | ||
export const Secondary = Template.bind({}) | ||
Secondary.args = { | ||
label: 'Button', | ||
}; | ||
label: 'Button' | ||
} | ||
|
||
export const Large = Template.bind({}); | ||
export const Large = Template.bind({}) | ||
Large.args = { | ||
size: 'large', | ||
label: 'Button', | ||
}; | ||
label: 'Button' | ||
} | ||
|
||
export const Small = Template.bind({}); | ||
export const Small = Template.bind({}) | ||
Small.args = { | ||
size: 'small', | ||
label: 'Button', | ||
}; | ||
label: 'Button' | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
import React from 'react'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
import React from 'react' | ||
import { ComponentStory, ComponentMeta } from '@storybook/react' | ||
|
||
import { Header } from './Header'; | ||
import { Header } from './Header' | ||
|
||
export default { | ||
const componentMeta: ComponentMeta<typeof Header> = { | ||
title: 'Example/Header', | ||
component: Header, | ||
parameters: { | ||
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout | ||
layout: 'fullscreen', | ||
}, | ||
} as ComponentMeta<typeof Header>; | ||
layout: 'fullscreen' | ||
} | ||
} | ||
|
||
const Template: ComponentStory<typeof Header> = (args) => <Header {...args} />; | ||
export default componentMeta | ||
|
||
export const LoggedIn = Template.bind({}); | ||
const Template: ComponentStory<typeof Header> = (args) => <Header {...args} /> | ||
|
||
export const LoggedIn = Template.bind({}) | ||
LoggedIn.args = { | ||
user: { | ||
name: 'Jane Doe', | ||
}, | ||
}; | ||
name: 'Jane Doe' | ||
} | ||
} | ||
|
||
export const LoggedOut = Template.bind({}); | ||
LoggedOut.args = {}; | ||
export const LoggedOut = Template.bind({}) | ||
LoggedOut.args = {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import React from 'react'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
import { within, userEvent } from '@storybook/testing-library'; | ||
import { Page } from './Page'; | ||
import React from 'react' | ||
import { ComponentStory, ComponentMeta } from '@storybook/react' | ||
import { within, userEvent } from '@storybook/testing-library' | ||
import { Page } from './Page' | ||
|
||
export default { | ||
const componentMeta: ComponentMeta<typeof Page> = { | ||
title: 'Example/Page', | ||
component: Page, | ||
parameters: { | ||
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout | ||
layout: 'fullscreen', | ||
}, | ||
} as ComponentMeta<typeof Page>; | ||
layout: 'fullscreen' | ||
} | ||
} | ||
export default componentMeta | ||
|
||
const Template: ComponentStory<typeof Page> = (args) => <Page {...args} />; | ||
const Template: ComponentStory<typeof Page> = (args) => <Page {...args} /> | ||
|
||
export const LoggedOut = Template.bind({}); | ||
export const LoggedOut = Template.bind({}) | ||
|
||
export const LoggedIn = Template.bind({}); | ||
export const LoggedIn = Template.bind({}) | ||
|
||
// More on interaction testing: https://storybook.js.org/docs/react/writing-tests/interaction-testing | ||
LoggedIn.play = async ({ canvasElement }) => { | ||
const canvas = within(canvasElement); | ||
const loginButton = await canvas.getByRole('button', { name: /Log in/i }); | ||
await userEvent.click(loginButton); | ||
}; | ||
const canvas = within(canvasElement) | ||
const loginButton = await canvas.getByRole('button', { name: /Log in/i }) | ||
await userEvent.click(loginButton) | ||
} |
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