Tom Coleman 383d4ba861 Revert "Undo accidental push of tom/sb-557-typescript-2"
This reverts commit 1cfc7203af2dd81d9484d1a569c9fb4e31396ea0.
2022-10-12 13:20:38 +11:00

25 lines
742 B
JavaScript

import { within, userEvent } from '@storybook/testing-library';
import { Page } from './Page';
export default {
title: 'Example/Page',
component: Page,
parameters: {
// More on Story layout: https://storybook.js.org/docs/preact/configure/story-layout
layout: 'fullscreen',
},
};
const Template = (args) => <Page {...args} />;
export const LoggedOut = Template.bind({});
// More on interaction testing: https://storybook.js.org/docs/preact/writing-tests/interaction-testing
export const LoggedIn = Template.bind({});
LoggedIn.play = async ({ canvasElement }) => {
const canvas = within(canvasElement);
const loginButton = await canvas.getByRole('button', { name: /Log in/i });
await userEvent.click(loginButton);
};