storybook/docs/snippets/common/storybook-interactions-step-function.js.mdx
Kyle Gach 2cee61b651 Update snippets to CSF 3
- Fix some minor errors
2022-12-05 12:37:36 -07:00

17 lines
451 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'));
});
},
};
```