-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: clean components & focus after tests #11210
chore: clean components & focus after tests #11210
Conversation
Thought https://github.com/ncoden/foundation-sites/blob/814d2e55f2313675c558d2d520b423bf02a79b4e/test/javascript/components/dropdownMenu.js#L45 already does this. |
Updated my PR description:
|
True. I don't know why I got this working when testing... I'll investigate further. |
According to me, the "works well alone but not after others tests" thing indicates that something is not cleared correctly, in tests or components. |
Focus caused by others tests was the problem. IE seems to not handle it correctly when an element is focused, then removed and an other element is focused, all of that synchronously. If we add a timeout just before the second element is focused, or if we clear the focus before the first element is removed, the second element is focused correctly. I really think this is a browser issue because the Foundation components involved in this issue ( Tests runs well now and I don't think there is anything we can change in the component itself. @DanielRuf What do you think ? |
This was not introduced by this PR. See tests for for |
See #11210 (comment). Do you want me to add these comments back ? |
Probably as these describe what happens there. |
9d39644 docs: add back comments in dropdownMenu tests |
…-after-tests for v6.5.0 b7ccd98 chore: clean component after DropdownMenu tests foundation#11074 814d2e5 chore: clean component after Toggler tests f9b61ff chore: clean focus after tests involving focus 9d39644 docs: add back comments in dropdownMenu tests Signed-off-by: Nicolas Coden <nicolas@ncoden.fr>
Description
After tests are run, any HTML added must be removed as the DOM is shared with others tests. Otherwise, there can be side effects on others tests.
This is what happened with
DropdownMenu
, where one drodown that was not removed made an other tests failing by changing the way the browser should handle the focus.Changes
They was not cleared as
$html
andplugin
were re-defined in tests, overriding already created$html
andplugin
and making them not being cleared.Types of changes
functionality to change)
Checklist (all required):
develop
orsupport/*
).