Skip to content

Commit 34bd987

Browse files
fix(frontend): await modal focus in storybook interaction
Signed-off-by: harshvardhan-yc <harshvardhan@yosemitecrew.com>
1 parent 5cbb255 commit 34bd987

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/frontend/src/app/ui/overlays/Modal/ModalBase.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Meta, StoryObj } from '@storybook/react';
2-
import { expect, userEvent, within } from 'storybook/test';
2+
import { expect, userEvent, waitFor, within } from 'storybook/test';
33
import React, { useState } from 'react';
44
import ModalBase from './ModalBase';
55

@@ -133,7 +133,7 @@ export const FocusTrap: Story = {
133133
const firstFocusable = modal.querySelector<HTMLElement>(
134134
'a[href], button:not([disabled]), input:not([disabled])'
135135
);
136-
expect(firstFocusable).toHaveFocus();
136+
await waitFor(() => expect(firstFocusable).toHaveFocus());
137137
},
138138
parameters: {
139139
docs: {

0 commit comments

Comments
 (0)