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 offline/online events #1205

Merged
merged 1 commit into from Jan 16, 2023
Merged

Conversation

JCB-K
Copy link
Contributor

@JCB-K JCB-K commented Jan 16, 2023

What:

Added support for the offline and online
event to fireEvent.

Why:

To test code that listens for the events.

How:

added events to event-map.js

Checklist:

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

This is my first contribution so I'm unsure if I did it all right, feel free to provide candid feedback!

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 16, 2023

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 86405b8:

Sandbox Source
react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Jan 16, 2023

Codecov Report

Merging #1205 (86405b8) into main (9f363af) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main     #1205   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines          998       998           
  Branches       327       327           
=========================================
  Hits           998       998           
Flag Coverage Δ
node-12 100.00% <ø> (ø)
node-14 100.00% <ø> (ø)
node-16 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/event-map.js 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thanks! Can you add these to types/events.d.ts as well?

@JCB-K
Copy link
Contributor Author

JCB-K commented Jan 16, 2023

@eps1lon done! I assumed they were inferred from events-map.js :)

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thanks!

@eps1lon eps1lon merged commit 0ce0c70 into testing-library:main Jan 16, 2023
@JCB-K JCB-K deleted the online/offline branch January 17, 2023 08:51
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