Skip to content

Commit

Permalink
Fix event dispatch in page
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Jun 14, 2024
1 parent e49ffbd commit 3bfb495
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/e2e/specs/interactivity/deferred-store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ test.describe( 'deferred store', () => {
} ) => {
const resultInput = page.getByTestId( 'result' );
await expect( resultInput ).toHaveText( '' );
window.dispatchEvent( new Event( '_test_proceed_' ) );
await page.evaluate( () => {
window.dispatchEvent( new Event( '_test_proceed_' ) );
} );
await expect( resultInput ).toHaveText( 'Hello, world!' );
} );

Expand All @@ -32,7 +34,9 @@ test.describe( 'deferred store', () => {
} ) => {
const resultInput = page.getByTestId( 'result-getter' );
await expect( resultInput ).toHaveText( '' );
window.dispatchEvent( new Event( '_test_proceed_' ) );
await page.evaluate( () => {
window.dispatchEvent( new Event( '_test_proceed_' ) );
} );
await expect( resultInput ).toHaveText( 'Hello, world!' );
} );
} );

0 comments on commit 3bfb495

Please sign in to comment.