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

feat: Add window events "pagehide" / "pageshow" #1308

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

jdufresne
Copy link
Contributor

What:

Add window events "pagehide" / "pageshow" to fireEvent API.

Why:

MDN documentation for these events is at:

https://developer.mozilla.org/en-US/docs/Web/API/Window/pagehide_event https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event

By adding these events, it allows library users to use the familiar fireEvent & friends in their test environments to verify pagehide and pageshow behavior.

How:

Add the events as entries in src/event-map.js.

Checklist:

  • Documentation added to the
    docs site N/A
  • Tests
  • TypeScript definitions updated
  • Ready to be merged

MDN documentation at:

https://developer.mozilla.org/en-US/docs/Web/API/Window/pagehide_event
https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event

By adding these events, it allows library users to use the familiar
fireEvent & friends in their test environments to verify pagehide and
pageshow behavior.
Copy link

codesandbox-ci bot commented Apr 27, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 348b862:

Sandbox Source
react-testing-library-examples Configuration

Copy link
Member

@MatanBobi MatanBobi left a comment

Choose a reason for hiding this comment

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

Thanks :)

@MatanBobi MatanBobi merged commit 56543d5 into testing-library:main Apr 29, 2024
4 checks passed
@jdufresne jdufresne deleted the pagehide branch May 4, 2024 14:52
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

2 participants