2022-10-31 10:59:17 +01:00

24 lines
715 B
JavaScript

import { within, userEvent } from '@storybook/testing-library';
import { createPage } from './Page';
export default {
title: 'Example/Page',
parameters: {
// More on Story layout: https://storybook.js.org/docs/html/configure/story-layout
layout: 'fullscreen',
},
};
const Template = () => createPage();
export const LoggedOut = Template.bind({});
export const LoggedIn = Template.bind({});
// More on interaction testing: https://storybook.js.org/docs/html/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);
};