Kasper Peulen 1b08b3fdcf Svelte: Remove render functions and infer argTypes for CLI templates
I also tried to align more with svelte conventions:
- Forward click event with on:click
- Don't use props for events like you would do in react
2022-11-29 15:46:07 +01:00

26 lines
701 B
JavaScript

import { within, userEvent } from '@storybook/testing-library';
import Page from './Page.svelte';
export default {
title: 'Example/Page',
component: Page,
parameters: {
// More on how to position stories at: https://storybook.js.org/docs/7.0/svelte/configure/story-layout
layout: 'fullscreen',
},
};
export const LoggedOut = {};
// More on interaction testing: https://storybook.js.org/docs/7.0/svelte/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);
},
};