File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,9 @@ export const EscapeKeyCloses: Story = {
205205 const modal = document . querySelector ( '[role="dialog"]' ) ;
206206 await expect ( modal ) . toBeInTheDocument ( ) ;
207207
208+ // Wait for modal to be fully mounted and event listeners attached
209+ await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) ) ;
210+
208211 // Press Escape key
209212 await userEvent . keyboard ( "{Escape}" ) ;
210213
@@ -243,6 +246,9 @@ export const OverlayClickCloses: Story = {
243246 const modal = document . querySelector ( '[role="dialog"]' ) ;
244247 await expect ( modal ) . toBeInTheDocument ( ) ;
245248
249+ // Wait for modal to be fully mounted and event listeners attached
250+ await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) ) ;
251+
246252 // Click on overlay (role="presentation")
247253 const overlay = document . querySelector ( '[role="presentation"]' ) ;
248254 await expect ( overlay ) . toBeInTheDocument ( ) ;
You can’t perform that action at this time.
0 commit comments