Skip to content

Commit

Permalink
Fix search test warning
Browse files Browse the repository at this point in the history
* missing act
* the closing would result in further state changes that were not captured by the fireEvent.click
* solution: wrap next check in waitFor
  • Loading branch information
igorschoester committed Apr 27, 2024
1 parent c5320d8 commit f23c38e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/js/tests/settings/search.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ describe( "Search", () => {
it( "should close on click", async() => {
expect( screen.getByRole( "dialog" ) ).toBeTruthy();
fireEvent.click( screen.getByRole( "button", { name: "Close" } ) );
expect( screen.queryByRole( "dialog" ) ).toBe( null );
await waitFor( () => {
expect( screen.queryByRole( "dialog" ) ).toBe( null );
}, { timeout: 1000 } );
} );
} );

Expand Down

0 comments on commit f23c38e

Please sign in to comment.