Skip to content
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

restore product tour test, fixing leak in dialogHelperTest #57975

Merged
merged 5 commits into from Apr 12, 2024

Conversation

davidsbailey
Copy link
Member

@davidsbailey davidsbailey commented Apr 11, 2024

The product tour unit test (currently disabled) has been passing when run individually but failing when run as part of the apps test suite. a binary search of all unit tests revealed the dialogHelperTest was to blame. the root cause is that when this test stubs out and restores jQuery, it leaves a new window.jQuery = undefined property on the window object. Root cause for why this breaks the product tour test was not confirmed, but one guess is that the introjs library, which the product tour depends on, checks for the presence of jQuery in a way that is sensitive to this difference: https://github.com/usablica/intro.js/blob/3cab7911743415f25bd5d9ba250bf69f9e8273f9/src/util/cloneObject.ts#L14

The solution is to fix the leak by removing the jQuery property from the window object after dialogHelperTest runs.

alternatives considered -- run the leaky test last: #57939

thanks to @Nokondi and @wilkie for all the time spent narrowing down this elusive test issue!

Testing story

passing drone run as well as local yarn test:unit

@davidsbailey davidsbailey marked this pull request as ready for review April 12, 2024 17:22
@davidsbailey davidsbailey requested review from Nokondi, a team and wilkie April 12, 2024 17:22
Copy link
Contributor

@Nokondi Nokondi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work

@davidsbailey davidsbailey merged commit 2a4e0c1 into staging Apr 12, 2024
2 checks passed
@davidsbailey davidsbailey deleted the restore-product-tour-delete-window-jquery branch April 12, 2024 19:23
@davidsbailey
Copy link
Member Author

Thanks Mark, thank you both for all the hard work too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants