mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-20 05:02:37 +08:00
15 lines
425 B
Plaintext
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'));
|
|
});
|
|
};
|
|
```
|