Hi, there.
I have a hook that fetch select options on user input, and values are passed to an external js library.
This hook uses pushEvent(event, payload)
, where payload
is a string, such as "bar"
.
unsigned_params
received on facing liveview in handle_event/3
is the payload : "bar"
.
I can not use Phoenix.LiveViewTest.render_hook/3
to test this hook, as there is a guard clause on the value: is_map/1
or is_list/1
.
So I can write hook and liveview that sends and receive a "bar"
payload, but I can not write a test for it?
What do you think on the datatype of Phoenix.LiveView.handle_event/3? Could unsigned_params
datatype be unioned with string and number?
Cheers!