restore product tour test, fixing leak in dialogHelperTest #57975
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 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#L14The 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