File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 11import {
2+ createEvent ,
23 fireEvent ,
34 isInaccessible ,
45 queries ,
@@ -144,6 +145,10 @@ function eventTest() {
144145 throw new Error ( `Can't find firstChild` )
145146 }
146147 fireEvent . click ( element . firstChild )
148+
149+ // Custom event
150+ const customEvent = createEvent ( 'customEvent' , element )
151+ fireEvent ( element , customEvent )
147152}
148153
149154async function testWaitFors ( ) {
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ export type FireObject = {
9494 ) => boolean
9595}
9696export type CreateFunction = (
97- eventName : EventType ,
97+ eventName : string ,
9898 node : Document | Element | Window | Node ,
9999 init ?: { } ,
100100 options ?: { EventType ?: string ; defaultInit ?: { } } ,
@@ -106,5 +106,5 @@ export type CreateObject = {
106106 ) => Event
107107}
108108
109- export const createEvent : CreateObject
109+ export const createEvent : CreateObject & CreateFunction
110110export const fireEvent : FireFunction & FireObject
You can’t perform that action at this time.
0 commit comments