Skip to content

Commit

Permalink
Fix Svelte stories
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed May 27, 2024
1 parent 4ac11ac commit 921b569
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions code/renderers/svelte/template/cli/js/Page.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { within, userEvent, expect } from '@storybook/test';
import { within, userEvent, expect, waitFor } from '@storybook/test';

import Page from './Page.svelte';

Expand All @@ -20,7 +20,7 @@ export const LoggedIn = {
const loginButton = canvas.getByRole('button', { name: /Log in/i });
await expect(loginButton).toBeInTheDocument();
await userEvent.click(loginButton);
await expect(loginButton).not.toBeInTheDocument();
await waitFor(() => expect(loginButton).not.toBeInTheDocument());

const logoutButton = canvas.getByRole('button', { name: /Log out/i });
await expect(logoutButton).toBeInTheDocument();
Expand Down
4 changes: 2 additions & 2 deletions code/renderers/svelte/template/cli/ts-3-8/Page.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/svelte';
import { within, userEvent, expect } from '@storybook/test';
import { within, userEvent, expect, waitFor } from '@storybook/test';

import Page from './Page.svelte';

Expand All @@ -24,7 +24,7 @@ export const LoggedIn: Story = {
const loginButton = canvas.getByRole('button', { name: /Log in/i });
await expect(loginButton).toBeInTheDocument();
await userEvent.click(loginButton);
await expect(loginButton).not.toBeInTheDocument();
await waitFor(() => expect(loginButton).not.toBeInTheDocument());

const logoutButton = canvas.getByRole('button', { name: /Log out/i });
await expect(logoutButton).toBeInTheDocument();
Expand Down
4 changes: 2 additions & 2 deletions code/renderers/svelte/template/cli/ts-4-9/Page.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/svelte';
import { within, userEvent, expect } from '@storybook/test';
import { within, userEvent, expect, waitFor } from '@storybook/test';

import Page from './Page.svelte';

Expand All @@ -24,7 +24,7 @@ export const LoggedIn: Story = {
const loginButton = canvas.getByRole('button', { name: /Log in/i });
await expect(loginButton).toBeInTheDocument();
await userEvent.click(loginButton);
await expect(loginButton).not.toBeInTheDocument();
await waitFor(() => expect(loginButton).not.toBeInTheDocument());

const logoutButton = canvas.getByRole('button', { name: /Log out/i });
await expect(logoutButton).toBeInTheDocument();
Expand Down

0 comments on commit 921b569

Please sign in to comment.