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 467 forks source link

fix: load and error dispatch `Event` instead of `UIEvent` #1147

Closed eps1lon closed 2 years ago

eps1lon commented 2 years ago

What:

fireEvent.load (et. al.) dispatches a Event now instead of UIEvent Adds a test for https://github.com/testing-library/dom-testing-library/issues/498

Why:

I imagine that the most common targets are <img /> and <script /> and neither of these receive load events as UIEvent: https://codesandbox.io/s/react-script-does-not-work-the-way-you-think-it-does-stc66c

How:

Changed event type and added tests for <script />. Ieft a note that our abstraction doesn't support firing events with different types.

Also removed the notion of "Image events" from comments. We refer to DOM interfaces in all other cases. But there is no such thing as ImageEvent.

Checklist:

codesandbox-ci[bot] commented 2 years 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 25b044bddeeef0b03a910711ba2a2813203fa694:

Sandbox Source
react-testing-library-examples Configuration
React: Githubissues.
  • Githubissues is a development platform for aggregating issues.