[USWDS] Modal | return early if no modal#4282
Merged
Merged
Conversation
… to update as needed
mejiaj
previously requested changes
Aug 9, 2021
mejiaj
left a comment
Contributor
There was a problem hiding this comment.
LGTM, can you please add a comment as to why we're adding this. In case Mocha adds a better way to prevent these types of conflicts in the future.
aduth
reviewed
Aug 10, 2021
| accordionButton.click(); | ||
| EVENTS.escape(accordionButton); | ||
| assert.strictEqual(accordionButton.getAttribute("aria-expanded"), "false"); | ||
| setTimeout(() => { |
Contributor
There was a problem hiding this comment.
Mocha won't wait for this timeout unless you add done as an argument and call it in the callback. Otherwise you may observe some strange side effects in subsequent tests based on the code executed after the delay.
Contributor
Author
There was a problem hiding this comment.
you're right @aduth, will take another look
mejiaj
approved these changes
Aug 13, 2021
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.
Description
We seem to need a delay before handling the event, this gives us a bit of space and allows the test to successfully pass.setting an early return so we don't query null items
Before you hit Submit, make sure you’ve done whichever of these applies to you:
npm testand make sure the tests for the files you have changed have passed.