UNPKG

@storybook/html

Version:
25 lines (21 loc) 702 B
import { within, userEvent } from '@storybook/testing-library'; import { createPage } from './Page'; export default { title: 'Example/Page', render: () => createPage(), parameters: { // More on how to position stories at: https://storybook.js.org/docs/html/configure/story-layout layout: 'fullscreen', }, }; export const LoggedOut = {}; // More on interaction testing: https://storybook.js.org/docs/html/writing-tests/interaction-testing export const LoggedIn = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); const loginButton = await canvas.getByRole('button', { name: /Log in/i, }); await userEvent.click(loginButton); }, };