mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-15 00:05:35 +08:00
feat: use find to query element on play function
This commit is contained in:
parent
b26d8f4cb2
commit
88cdcffd2c
@ -23,6 +23,6 @@ export const LoggedOut = Template.bind({});
|
|||||||
export const LoggedIn = Template.bind({});
|
export const LoggedIn = Template.bind({});
|
||||||
LoggedIn.play = async ({ canvasElement }) => {
|
LoggedIn.play = async ({ canvasElement }) => {
|
||||||
const canvas = within(canvasElement);
|
const canvas = within(canvasElement);
|
||||||
const loginButton = await canvas.getByRole('button', { name: /Log in/i });
|
const loginButton = await canvas.findByRole('button', { name: /Log in/i });
|
||||||
await userEvent.click(loginButton);
|
await userEvent.click(loginButton);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user