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

Tests: Make the beforeunload event tests work regardless of extensions #5478

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

mgol
Copy link
Member

@mgol mgol commented Apr 24, 2024

Summary

Some browser extensions, like React DevTools, send messages to the content area. Since our beforeunload event test listens for all messages, it used to catch those as well, failing the test.

Add a source field to the payload JSON and check for it before treating the message as coming from our own test to make sure the test passes even with such browser extensions installed.

Checklist

Some browser extensions, like React DevTools, send messages to the content area.
Since our beforeunload event test listens for all messages, it used to catch
those as well, failing the test.

Add a `source` field to the payload JSON and check for it before treating the
message as coming from our own test to make sure the test passes even with such
browser extensions installed.
@mgol mgol added this to the 3.7.2 milestone Apr 24, 2024
@mgol mgol self-assigned this Apr 24, 2024
@mgol mgol merged commit 399a78e into jquery:main Apr 24, 2024
13 checks passed
@mgol mgol deleted the event-test-resilience branch April 24, 2024 22:24
@mgol mgol removed the Needs review label Apr 24, 2024
mgol added a commit that referenced this pull request Apr 24, 2024
Some browser extensions, like React DevTools, send messages to the content area.
Since our beforeunload event test listens for all messages, it used to catch
those as well, failing the test.

Add a `source` field to the payload JSON and check for it before treating the
message as coming from our own test to make sure the test passes even with such
browser extensions installed.

Closes gh-5478

(cherry picked from commit 399a78e)
@mgol
Copy link
Member Author

mgol commented Apr 24, 2024

Landed on main in 399a78e and on 3.x-stable in 5d83fad.

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

Successfully merging this pull request may close these issues.

None yet

2 participants