Closed
Description
Describe the feature you'd like:
In creating a custom router, I was adding some tests around popstate events, and reached for this in dom-testing-library
, but noticed popstate was missing. I ended up doing this natively, but was wondering if you would accept a PR adding PopStateEvent
. Optionally, we could add other WindowEventHandlers
.
Suggested implementation:
Adding them is as simple as updating the eventsMap
object in src/events
. Testing them would require a bit of new code as they all emit from the window object, in lieu of arbitrary DOM nodes.
Describe alternatives you've considered:
Not doing this at all and instead using window.dispatchEvent(new window.PopStateEvent('popstate'));
in my test.
Teachability, Documentation, Adoption, Migration Strategy:
This change would not require any large changes, but perhaps some additional documentation around availability.