Skip to content

Commit

Permalink
Forsøk på å fikse flaky storybook test (#6630)
Browse files Browse the repository at this point in the history
  • Loading branch information
hallvardastark authored Sep 26, 2024
1 parent 90dcf6c commit d6b0a18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/sak-app/src/app/ErrorBoundary.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ErrorBoundary from './ErrorBoundary.js';
import { Meta, StoryObj } from '@storybook/react';
import { fn, expect } from '@storybook/test';
import { expect, fn, waitFor } from '@storybook/test';
import { useEffect } from 'react';
import ErrorBoundary from './ErrorBoundary.js';

const meta = {
title: 'sak/sak-app',
Expand Down Expand Up @@ -37,7 +37,7 @@ export const ErrorBoundaryTriggered: Story = {
children: <FailingChild />,
},
play: async ({ canvas, args }) => {
await expect(args.errorMessageCallback).toHaveBeenCalledOnce();
await waitFor(() => expect(args.errorMessageCallback).toHaveBeenCalledOnce());
await expect(canvas.getByRole('heading')).toHaveTextContent(
'Det har oppstått en teknisk feil i denne behandlingen.',
);
Expand Down

0 comments on commit d6b0a18

Please sign in to comment.