testing-library / dom-testing-library

πŸ™ Simple and complete DOM testing utilities that encourage good testing practices.
https://testing-library.com/dom
MIT License
3.26k stars 466 forks source link

feat: add offline/online events #1205

Closed JCB-K closed 1 year ago

JCB-K commented 1 year ago

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:

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

codesandbox-ci[bot] commented 1 year ago

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

Sandbox Source
react-testing-library-examples Configuration
codecov[bot] commented 1 year ago

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% <ΓΈ> (ΓΈ)

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

JCB-K commented 1 year ago

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