Class: FakeMouseEvent
Defined in: packages/dom-core/src/fakeEvents/FakeMouseEvent.ts:5
Fake mouse event for testing.
See
https://github.com/testing-library/react-testing-library/issues/268
Extends
MouseEvent
Constructors
Constructor
new FakeMouseEvent(
type
,overrides
):FakeMouseEvent
Defined in: packages/dom-core/src/fakeEvents/FakeMouseEvent.ts:6
Parameters
type
string
overrides
Partial
<MouseEvent
> = {}
Returns
FakeMouseEvent
Overrides
MouseEvent.constructor
Properties
altKey
readonly
altKey:boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16549
Inherited from
MouseEvent.altKey
AT_TARGET
readonly
AT_TARGET:2
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8765
Inherited from
MouseEvent.AT_TARGET
bubbles
readonly
bubbles:boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8660
Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
Inherited from
MouseEvent.bubbles
BUBBLING_PHASE
readonly
BUBBLING_PHASE:3
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8766
Inherited from
MouseEvent.BUBBLING_PHASE
button
readonly
button:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16551
Inherited from
MouseEvent.button
buttons
readonly
buttons:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16553
Inherited from
MouseEvent.buttons
cancelable
readonly
cancelable:boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8672
Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.
Inherited from
MouseEvent.cancelable
cancelBubble
cancelBubble:
boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8666
Deprecated
Inherited from
MouseEvent.cancelBubble
CAPTURING_PHASE
readonly
CAPTURING_PHASE:1
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8764
Inherited from
MouseEvent.CAPTURING_PHASE
clientX
readonly
clientX:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16555
Inherited from
MouseEvent.clientX
clientY
readonly
clientY:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16557
Inherited from
MouseEvent.clientY
composed
readonly
composed:boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8678
Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.
Inherited from
MouseEvent.composed
ctrlKey
readonly
ctrlKey:boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16559
Inherited from
MouseEvent.ctrlKey
currentTarget
readonly
currentTarget:null
|EventTarget
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8684
Returns the object whose event listener's callback is currently being invoked.
Inherited from
MouseEvent.currentTarget
defaultPrevented
readonly
defaultPrevented:boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8690
Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
Inherited from
MouseEvent.defaultPrevented
detail
readonly
detail:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:23812
Inherited from
MouseEvent.detail
eventPhase
readonly
eventPhase:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8696
Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
Inherited from
MouseEvent.eventPhase
isTrusted
readonly
isTrusted:boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8702
Returns true if event was dispatched by the user agent, and false otherwise.
Inherited from
MouseEvent.isTrusted
layerX
readonly
layerX:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16561
Inherited from
MouseEvent.layerX
layerY
readonly
layerY:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16563
Inherited from
MouseEvent.layerY
metaKey
readonly
metaKey:boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16565
Inherited from
MouseEvent.metaKey
movementX
readonly
movementX:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16567
Inherited from
MouseEvent.movementX
movementY
readonly
movementY:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16569
Inherited from
MouseEvent.movementY
NONE
readonly
NONE:0
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8763
Inherited from
MouseEvent.NONE
offsetX
readonly
offsetX:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16571
Inherited from
MouseEvent.offsetX
offsetY
readonly
offsetY:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16573
Inherited from
MouseEvent.offsetY
pageX
readonly
pageX:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16575
Inherited from
MouseEvent.pageX
pageY
readonly
pageY:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16577
Inherited from
MouseEvent.pageY
relatedTarget
readonly
relatedTarget:null
|EventTarget
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16579
Inherited from
MouseEvent.relatedTarget
returnValue
returnValue:
boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8708
Deprecated
Inherited from
MouseEvent.returnValue
screenX
readonly
screenX:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16581
Inherited from
MouseEvent.screenX
screenY
readonly
screenY:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16583
Inherited from
MouseEvent.screenY
shiftKey
readonly
shiftKey:boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16585
Inherited from
MouseEvent.shiftKey
srcElement
readonly
srcElement:null
|EventTarget
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8714
Deprecated
Inherited from
MouseEvent.srcElement
target
readonly
target:null
|EventTarget
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8720
Returns the object to which event is dispatched (its target).
Inherited from
MouseEvent.target
timeStamp
readonly
timeStamp:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8726
Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
Inherited from
MouseEvent.timeStamp
type
readonly
type:string
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8732
Returns the type of event, e.g. "click", "hashchange", or "submit".
Inherited from
MouseEvent.type
view
readonly
view:null
|Window
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:23814
Inherited from
MouseEvent.view
which
readonly
which:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:23820
Deprecated
Inherited from
MouseEvent.which
x
readonly
x:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16587
Inherited from
MouseEvent.x
y
readonly
y:number
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16589
Inherited from
MouseEvent.y
Methods
composedPath()
Call Signature
composedPath():
EventTarget
[]
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8738
Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
Returns
EventTarget
[]
Inherited from
MouseEvent.composedPath
Call Signature
composedPath():
EventTarget
[]
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.webworker.d.ts:2783
Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
Returns
EventTarget
[]
Inherited from
MouseEvent.composedPath
getModifierState()
getModifierState(
keyArg
):boolean
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16591
Parameters
keyArg
string
Returns
boolean
Inherited from
MouseEvent.getModifierState
initEvent()
Call Signature
initEvent(
type
,bubbles
?,cancelable
?):void
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8744
Parameters
type
string
bubbles?
boolean
cancelable?
boolean
Returns
void
Deprecated
Inherited from
MouseEvent.initEvent
Call Signature
initEvent(
type
,bubbles
?,cancelable
?):void
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.webworker.d.ts:2789
Parameters
type
string
bubbles?
boolean
cancelable?
boolean
Returns
void
Deprecated
Inherited from
MouseEvent.initEvent
initMouseEvent()
initMouseEvent(
typeArg
,canBubbleArg
,cancelableArg
,viewArg
,detailArg
,screenXArg
,screenYArg
,clientXArg
,clientYArg
,ctrlKeyArg
,altKeyArg
,shiftKeyArg
,metaKeyArg
,buttonArg
,relatedTargetArg
):void
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:16597
Parameters
typeArg
string
canBubbleArg
boolean
cancelableArg
boolean
viewArg
Window
detailArg
number
screenXArg
number
screenYArg
number
clientXArg
number
clientYArg
number
ctrlKeyArg
boolean
altKeyArg
boolean
shiftKeyArg
boolean
metaKeyArg
boolean
buttonArg
number
relatedTargetArg
null
| EventTarget
Returns
void
Deprecated
Inherited from
MouseEvent.initMouseEvent
initUIEvent()
initUIEvent(
typeArg
,bubblesArg
?,cancelableArg
?,viewArg
?,detailArg
?):void
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:23826
Parameters
typeArg
string
bubblesArg?
boolean
cancelableArg?
boolean
viewArg?
null
| Window
detailArg?
number
Returns
void
Deprecated
Inherited from
MouseEvent.initUIEvent
preventDefault()
Call Signature
preventDefault():
void
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8750
If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
Returns
void
Inherited from
MouseEvent.preventDefault
Call Signature
preventDefault():
void
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.webworker.d.ts:2795
If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
Returns
void
Inherited from
MouseEvent.preventDefault
stopImmediatePropagation()
Call Signature
stopImmediatePropagation():
void
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8756
Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
Returns
void
Inherited from
MouseEvent.stopImmediatePropagation
Call Signature
stopImmediatePropagation():
void
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.webworker.d.ts:2801
Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
Returns
void
Inherited from
MouseEvent.stopImmediatePropagation
stopPropagation()
Call Signature
stopPropagation():
void
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts:8762
When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
Returns
void
Inherited from
MouseEvent.stopPropagation
Call Signature
stopPropagation():
void
Defined in: node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.webworker.d.ts:2807
When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
Returns
void
Inherited from
MouseEvent.stopPropagation