test(useQuery): Ensure we await the rendered text we expect #338
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that CI was failing intermittently on a test and it was receiving an
act()
warning. I believe it's because we should be awaiting the find of the text to allow for async work to happen inuseQuery
.To reproduce locally, run
yarn test
thena
for all tests, then hitEnter
twice to do two full test runs in sequence. The subsequent runs should fail reliably on this test.This seemed to be introduced after my PR #332 perhaps due to fixing the GC issue, and a state update happening that isn't waited for during the test. Other tests do use
act
to do assertions as well, plus usingfind
for components that do async work seems a lot more reliable.Changes
act
warning that happens on subsequent test runs for testshould be in "success" state by default in manual mode