Open masakudamatsu opened 2 years ago
We need to mock the async implementation of getPlacePredictions() of Google Maps AutocompleteService API, so that Jest will update the DOM to include the <li> elements of autocomplete suggestions, whose ARIA-attributes we need to make assertions on.
getPlacePredictions()
<li>
To figure out how to mock it, see
Start with SearchBox.test.js in the stash called mock Autocomplete Services.
SearchBox.test.js
mock Autocomplete Services
importing window.google in both implementation and test code may work...
window.google
We need to mock the async implementation of
getPlacePredictions()
of Google Maps AutocompleteService API, so that Jest will update the DOM to include the<li>
elements of autocomplete suggestions, whose ARIA-attributes we need to make assertions on.To figure out how to mock it, see
Start with
SearchBox.test.js
in the stash calledmock Autocomplete Services
.