Module Virtual_dom_test_helpers.Handler
type tThe type representing an event handler e.g. onclick, onkeydown, etc... These event handlers can be triggered, but take care, accessing any of the fields on the event object in the callback will cause an exception to be raised.
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val of_any_exn : Js_of_ocaml.Js.Unsafe.any -> name:string -> tConverts a
js_anyinto a handler. Throws an exception if the value isn't a javascript function.
val trigger : ?extra_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> t -> unitTriggers the provided event handler.
Use the
extra_fieldsparameter in order to put extra fields on the event. This will let you simulate event handlers that read the event object's properties.