cljs-tlr.events
Low-level event firing utilities.
These functions fire DOM events directly on elements. For most tests, prefer cljs-tlr.user-event which simulates real user interactions more accurately (e.g., firing focus, keydown, keyup, and input events for typing, not just a single event).
Use these functions when you need precise control over individual events or when testing event handlers directly.
blur
(blur element)Fires a blur event on the element.
change
(change element value)Fires a change event with the given value.
For input elements, pass the new value and it will be set on event.target.value.
click
(click element)Fires a click event on the element.
dbl-click
(dbl-click element)Fires a double-click event on the element.
drag
(drag element)Fires a drag event on the element.
fire-drop
(fire-drop element)Fires a drop event on the element.
focus
(focus element)Fires a focus event on the element.
input
(input element value)Fires an input event with the given value.
key-down
(key-down element key-opts)Fires a keyDown event on the element.
The key-opts map should contain properties like :key, :code, :charCode, :keyCode, etc.
key-press
(key-press element key-opts)Fires a keyPress event on the element.
key-up
(key-up element key-opts)Fires a keyUp event on the element.
mouse-down
(mouse-down element)Fires a mouseDown event on the element.
mouse-enter
(mouse-enter element)Fires a mouseEnter event on the element.
mouse-leave
(mouse-leave element)Fires a mouseLeave event on the element.
mouse-out
(mouse-out element)Fires a mouseOut event on the element.
mouse-over
(mouse-over element)Fires a mouseOver event on the element.
mouse-up
(mouse-up element)Fires a mouseUp event on the element.
scroll
(scroll element)Fires a scroll event on the element.
submit
(submit element)Fires a submit event on a form element.