diff --git a/code/renderers/preact/template/cli/Page.stories.jsx b/code/renderers/preact/template/cli/Page.stories.jsx index bcc1bfa8ec74..46669ac1c89d 100644 --- a/code/renderers/preact/template/cli/Page.stories.jsx +++ b/code/renderers/preact/template/cli/Page.stories.jsx @@ -1,4 +1,4 @@ -import { within, userEvent, expect } from '@storybook/test'; +import { within, userEvent } from '@storybook/test'; import { Page } from './Page'; @@ -17,12 +17,9 @@ export const LoggedOut = {}; export const LoggedIn = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); - const loginButton = canvas.getByRole('button', { name: /Log in/i }); - await expect(loginButton).toBeInTheDocument(); + const loginButton = await canvas.getByRole('button', { + name: /Log in/i, + }); await userEvent.click(loginButton); - await expect(loginButton).not.toBeInTheDocument(); - - const logoutButton = canvas.getByRole('button', { name: /Log out/i }); - await expect(logoutButton).toBeInTheDocument(); }, };