fix nested acts - #1468
Open
snowystinger wants to merge 1 commit into
Open
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 899769f:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What:
Closes #1231
And removes the need for testing-library/user-event#1283
Why:
testing-library/user-event#1283
How:
By tracking if we're already inside an
act, we can avoid wrapping it in a new one. At the same time, we can keep the wrapper around all events, which is an expectation using testing library'sconfigureChecklist:
docs site
Originally I was going to make this change over in user event, we have two PRs to do it, however, it's really a React and Preact concern. Changing it in User Event would affect everyone. Angular testing library already wraps all events for a different reason and so removing an event from that callback wrapper could be unexpected or breaking. I would guess this change is also needed in the Preact testing library repo as well.