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.
The ProfileModal tests would sometimes fail with this error:
The
HTMLDialogElement.showModal
call happens in an effect when theModalDialog
component is rendered with theisClosed
prop set to false. In the ProfileModal tests, the component was rendered in a disconnected DOM node, so this error should have happened on every run. However theemitter.publish("openProfile")
call which triggered this render was not wrapped inact
and so the effect which callsshowModal
was scheduled, but often did not actually run before the component was unmounted in theafterEach
hook.Fix the issue by:
emitter.publish("openProfile")
calls inact
, so they synchronously execute the effect.ProfileModal
component in a connected DOM container which is removed after the test runs. This is what actually fixes the error shown above.NotebookModal
tests to work in the same way as the ProfileModal tests, with a single container element which is removed at the end of the test