-
Notifications
You must be signed in to change notification settings - Fork 468
Closed
Labels
enhancementNew feature or requestNew feature or requestneeds discussionWe need to discuss this to come up with a good solutionWe need to discuss this to come up with a good solution
Description
Access the event created by fireEvent
I would like to get access the event created by fireEvent
. I rely on event.timeStamp
to do calculations in my component and testing without access to the created event is complex.
Suggested implementation:
const { canceled, event } = fireEvent[key](node, { ...eventProps })
canceled
would be the result of element.dispatchEvent
(ie the current return value of fireEvent
) and event
would be the event created.
Describe alternatives you've considered:
- Base my calculations on
Date.now()
in my component - Use
timeStamp = Date.now() + 1
right beforefireEvent
(for some reason they equal thetimeStamp
created byfireEvent
- [current solution]: create the event manually and fire it with
fireEvent(element, event)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestneeds discussionWe need to discuss this to come up with a good solutionWe need to discuss this to come up with a good solution