package virtual_dom
Module Virtual_dom_test_helpers.Node_helpersSource
Source
type element = {tag_name : string;attributes : (string * string) list;string_properties : (string * string) list;bool_properties : (string * bool) list;styles : (string * string) list;handlers : (string * Handler.t) list;hooks : (string * Virtual_dom.Vdom.Attr.Hooks.For_testing.Extra.t) list;key : string option;children : t list;
}Roughly analogous to Vdom.Node.t, but more easily inspectable and represented as a pure OCaml type.
Source
val trigger :
?extra_fields:(string * Js_of_ocaml.Js.Unsafe.any) list ->
t ->
event_name:string ->
unitSource
val trigger_hook :
t ->
type_id:'t Core.Type_equal.Id.t ->
name:string ->
f:('t -> 'a -> unit Virtual_dom.Vdom.Effect.t) ->
arg:'a ->
unitWhen a hook-based attribute build from an event-returning function, this function will find the hook, extract the value, call that function with arg, and schedule the resulting function.
Given an element, this function attempts to retrieve a hook with the name name, and the type-id from the hooks For_testing module.
Convenience functions for trigger, closely modeling user interactions.