storybook/docs/snippets/common/storybook-interactions-step-function.js.mdx
2022-07-05 14:50:25 +02:00

15 lines
425 B
Plaintext

```js
Submitted.play = async ({ args, canvasElement, step }) => {
const canvas = within(canvasElement);
await step('Enter email and password', async () => {
await userEvent.type(canvas.getByTestId('email'), 'hi@example.com');
await userEvent.type(canvas.getByTestId('password'), 'supersecret');
});
await step('Submit form', async () => {
await userEvent.click(canvas.getByRole('button'));
});
};
```