MCPcopy Create free account
hub / github.com/testing-library/user-event / clickBooleanElement

Function clickBooleanElement

src/click.ts:50–71  ·  view source on GitHub ↗
(
  element: HTMLInputElement,
  init: MouseEventInit | undefined,
  {clickCount}: clickOptions & PointerOptions,
)

Source from the content-addressed store, hash-verified

48}
49
50function clickBooleanElement(
51 element: HTMLInputElement,
52 init: MouseEventInit | undefined,
53 {clickCount}: clickOptions & PointerOptions,
54) {
55 fireEvent.pointerDown(element, init)
56 if (!element.disabled) {
57 fireEvent.mouseDown(
58 element,
59 getMouseEventOptions('mousedown', init, clickCount),
60 )
61 }
62 focus(element)
63 fireEvent.pointerUp(element, init)
64 if (!element.disabled) {
65 fireEvent.mouseUp(
66 element,
67 getMouseEventOptions('mouseup', init, clickCount),
68 )
69 fireClick(element, getMouseEventOptions('click', init, clickCount))
70 }
71}
72
73function clickElement(
74 element: Element,

Callers 1

clickFunction · 0.85

Calls 3

getMouseEventOptionsFunction · 0.90
focusFunction · 0.90
fireClickFunction · 0.85

Tested by

no test coverage detected