diff --git a/src/components/@shared/atoms/Button.module.css b/src/components/@shared/atoms/Button/index.module.css similarity index 100% rename from src/components/@shared/atoms/Button.module.css rename to src/components/@shared/atoms/Button/index.module.css diff --git a/src/components/@shared/atoms/Button/index.stories.tsx b/src/components/@shared/atoms/Button/index.stories.tsx new file mode 100644 index 000000000..428f381a8 --- /dev/null +++ b/src/components/@shared/atoms/Button/index.stories.tsx @@ -0,0 +1,26 @@ +import React from 'react' +import { ComponentStory, ComponentMeta } from '@storybook/react' + +import Button, { ButtonProps } from '@shared/atoms/Button' + +// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export +export default { + title: 'Component/@shared/atoms/Button', + component: Button +} as ComponentMeta + +// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args +const Template: ComponentStory = (args: ButtonProps) => ( + ) : ( <> - + )} diff --git a/src/stories/Page.stories.tsx b/src/stories/Page.stories.tsx index 416b95a29..e6910ac04 100644 --- a/src/stories/Page.stories.tsx +++ b/src/stories/Page.stories.tsx @@ -17,10 +17,3 @@ const Template: ComponentStory = (args) => export const LoggedOut = 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) -} diff --git a/src/stories/Page.tsx b/src/stories/Page.tsx index 292fa91e5..df5abc18c 100644 --- a/src/stories/Page.tsx +++ b/src/stories/Page.tsx @@ -40,7 +40,7 @@ export const Page: React.VFC = () => {
  • Use a higher-level connected component. Storybook helps you compose - such data from the "args" of child component stories + such data from the "args" of child component stories
  • Assemble data in the page component from your services. You can mock