Skip to content
Advertisement

Test clearing of search input field on submit (after fetching)

I want to test that a search box does calls a handler (passed as prop) with the fetched results and resets the input field afterwards.

JavaScript
JavaScript

This is the error:

JavaScript

Advertisement

Answer

waitFor returns a Promise so you need to use await:

JavaScript
Advertisement