Class: FakeMouseEvent
@atomic-testing/dom-core.FakeMouseEvent
Fake mouse event for testing.
See
https://github.com/testing-library/react-testing-library/issues/268
Hierarchy
-
MouseEvent
↳
FakeMouseEvent
Constructors
constructor
• new FakeMouseEvent(type
, overrides?
): FakeMouseEvent
Parameters
Name | Type |
---|---|
type | string |
overrides | Partial <MouseEvent > |
Returns
Overrides
MouseEvent.constructor
Defined in
packages/dom-core/src/fakeEvents/FakeMouseEvent.ts:6
Properties
AT_TARGET
• Readonly
AT_TARGET: 2
Inherited from
MouseEvent.AT_TARGET
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8226
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2550
BUBBLING_PHASE
• Readonly
BUBBLING_PHASE: 3
Inherited from
MouseEvent.BUBBLING_PHASE
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8227
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2551
CAPTURING_PHASE
• Readonly
CAPTURING_PHASE: 1
Inherited from
MouseEvent.CAPTURING_PHASE
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8225
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2549
NONE
• Readonly
NONE: 0
Inherited from
MouseEvent.NONE
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8224
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2548
altKey
• Readonly
altKey: boolean
Inherited from
MouseEvent.altKey
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15863
bubbles
• Readonly
bubbles: boolean
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8121
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2445
button
• Readonly
button: number
Inherited from
MouseEvent.button
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15865
buttons
• Readonly
buttons: number
Inherited from
MouseEvent.buttons
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15867
cancelBubble
• cancelBubble: boolean
Deprecated
Inherited from
MouseEvent.cancelBubble
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8127
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2451
cancelable
• Readonly
cancelable: boolean
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8133
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2457
clientX
• Readonly
clientX: number
Inherited from
MouseEvent.clientX
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15869
clientY
• Readonly
clientY: number
Inherited from
MouseEvent.clientY
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15871
composed
• Readonly
composed: boolean
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8139
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2463
ctrlKey
• Readonly
ctrlKey: boolean
Inherited from
MouseEvent.ctrlKey
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15873
currentTarget
• Readonly
currentTarget: null
| EventTarget
Returns the object whose event listener's callback is currently being invoked.
Inherited from
MouseEvent.currentTarget
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8145
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2469
defaultPrevented
• Readonly
defaultPrevented: boolean
Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
Inherited from
MouseEvent.defaultPrevented
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8151
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2475
detail
• Readonly
detail: number
Inherited from
MouseEvent.detail
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:22847
eventPhase
• Readonly
eventPhase: number
Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
Inherited from
MouseEvent.eventPhase
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8157
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2481
isTrusted
• Readonly
isTrusted: boolean
Returns true if event was dispatched by the user agent, and false otherwise.
Inherited from
MouseEvent.isTrusted
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8163
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2487
layerX
• Readonly
layerX: number
Inherited from
MouseEvent.layerX
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15875
layerY
• Readonly
layerY: number
Inherited from
MouseEvent.layerY
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15877
metaKey
• Readonly
metaKey: boolean
Inherited from
MouseEvent.metaKey
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15879
movementX
• Readonly
movementX: number
Inherited from
MouseEvent.movementX
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15881
movementY
• Readonly
movementY: number
Inherited from
MouseEvent.movementY
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15883
offsetX
• Readonly
offsetX: number
Inherited from
MouseEvent.offsetX
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15885
offsetY
• Readonly
offsetY: number
Inherited from
MouseEvent.offsetY
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15887
pageX
• Readonly
pageX: number
Inherited from
MouseEvent.pageX
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15889
pageY
• Readonly
pageY: number
Inherited from
MouseEvent.pageY
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15891
relatedTarget
• Readonly
relatedTarget: null
| EventTarget
Inherited from
MouseEvent.relatedTarget
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15893
returnValue
• returnValue: boolean
Deprecated
Inherited from
MouseEvent.returnValue
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8169
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2493
screenX
• Readonly
screenX: number
Inherited from
MouseEvent.screenX
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15895
screenY
• Readonly
screenY: number
Inherited from
MouseEvent.screenY
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15897
shiftKey
• Readonly
shiftKey: boolean
Inherited from
MouseEvent.shiftKey
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15899
srcElement
• Readonly
srcElement: null
| EventTarget
Deprecated
Inherited from
MouseEvent.srcElement
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8175
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2499
target
• Readonly
target: null
| EventTarget
Returns the object to which event is dispatched (its target).
Inherited from
MouseEvent.target
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8181
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2505
timeStamp
• Readonly
timeStamp: number
Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
Inherited from
MouseEvent.timeStamp
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8187
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2511
type
• Readonly
type: string
Returns the type of event, e.g. "click", "hashchange", or "submit".
Inherited from
MouseEvent.type
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8193
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2517
view
• Readonly
view: null
| Window
Inherited from
MouseEvent.view
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:22849
which
• Readonly
which: number
Deprecated
Inherited from
MouseEvent.which
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:22855
x
• Readonly
x: number
Inherited from
MouseEvent.x
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15901
y
• Readonly
y: number
Inherited from
MouseEvent.y
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15903
Methods
composedPath
▸ composedPath(): EventTarget
[]
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8199
▸ composedPath(): EventTarget
[]
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2523
getModifierState
▸ getModifierState(keyArg
): boolean
Parameters
Name | Type |
---|---|
keyArg | string |
Returns
boolean
Inherited from
MouseEvent.getModifierState
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15905
initEvent
▸ initEvent(type
, bubbles?
, cancelable?
): void
Parameters
Name | Type |
---|---|
type | string |
bubbles? | boolean |
cancelable? | boolean |
Returns
void
Deprecated
Inherited from
MouseEvent.initEvent
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8205
▸ initEvent(type
, bubbles?
, cancelable?
): void
Parameters
Name | Type |
---|---|
type | string |
bubbles? | boolean |
cancelable? | boolean |
Returns
void
Deprecated
Inherited from
MouseEvent.initEvent
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2529
initMouseEvent
▸ initMouseEvent(typeArg
, canBubbleArg
, cancelableArg
, viewArg
, detailArg
, screenXArg
, screenYArg
, clientXArg
, clientYArg
, ctrlKeyArg
, altKeyArg
, shiftKeyArg
, metaKeyArg
, buttonArg
, relatedTargetArg
): void
Parameters
Name | Type |
---|---|
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:15911
initUIEvent
▸ initUIEvent(typeArg
, bubblesArg?
, cancelableArg?
, viewArg?
, detailArg?
): void
Parameters
Name | Type |
---|---|
typeArg | string |
bubblesArg? | boolean |
cancelableArg? | boolean |
viewArg? | null | Window |
detailArg? | number |
Returns
void
Deprecated
Inherited from
MouseEvent.initUIEvent
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:22861
preventDefault
▸ preventDefault(): void
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8211
▸ preventDefault(): void
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2535
stopImmediatePropagation
▸ stopImmediatePropagation(): void
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8217
▸ stopImmediatePropagation(): void
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2541
stopPropagation
▸ stopPropagation(): void
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts:8223
▸ stopPropagation(): void
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
Defined in
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.webworker.d.ts:2547