-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove warning for no extreneous deps in stories
- Loading branch information
Showing
4 changed files
with
55 additions
and
2 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
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 |
---|---|---|
|
@@ -8,6 +8,9 @@ | |
# testing | ||
/coverage | ||
|
||
# storybook | ||
storybook-static | ||
|
||
# cypress | ||
cypress/screenshots | ||
cypress/videos | ||
|
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,42 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { userEvent, within } from '@storybook/testing-library'; | ||
|
||
import { Main } from './Main'; | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction | ||
const meta: Meta<typeof Main> = { | ||
title: 'Example/Main', | ||
component: Main, | ||
tags: ['autodocs'], | ||
parameters: { | ||
// More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout | ||
layout: 'fullscreen', | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Main>; | ||
|
||
export const MainWithReactComponent: Story = { | ||
args: { | ||
children: <div>Children node</div>, | ||
}, | ||
}; | ||
|
||
export const MainWithString: Story = { | ||
args: { | ||
children: 'String', | ||
}, | ||
}; | ||
|
||
// More on interaction testing: https://storybook.js.org/docs/7.0/react/writing-tests/interaction-testing | ||
export const MainWithHomeLink: Story = { | ||
play: async ({ canvasElement }) => { | ||
const canvas = within(canvasElement); | ||
const loginButton = await canvas.getByRole('link', { | ||
name: /Home/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