|
@@ -223,12 +223,17 @@ def test_event_console_log():
|
|
|
)
|
|
|
assert (
|
|
|
format.format_event(spec)
|
|
|
- == 'Event("_call_function", {function:(() => (console["log"]("message")))})'
|
|
|
+ == 'Event("_call_function", {function:(() => (console["log"]("message"))),callback:null})'
|
|
|
)
|
|
|
spec = event.console_log(Var(_js_expr="message"))
|
|
|
assert (
|
|
|
format.format_event(spec)
|
|
|
- == 'Event("_call_function", {function:(() => (console["log"](message)))})'
|
|
|
+ == 'Event("_call_function", {function:(() => (console["log"](message))),callback:null})'
|
|
|
+ )
|
|
|
+ spec2 = event.console_log(Var(_js_expr="message2")).add_args(Var("throwaway"))
|
|
|
+ assert (
|
|
|
+ format.format_event(spec2)
|
|
|
+ == 'Event("_call_function", {function:(() => (console["log"](message2))),callback:null})'
|
|
|
)
|
|
|
|
|
|
|
|
@@ -243,12 +248,17 @@ def test_event_window_alert():
|
|
|
)
|
|
|
assert (
|
|
|
format.format_event(spec)
|
|
|
- == 'Event("_call_function", {function:(() => (window["alert"]("message")))})'
|
|
|
+ == 'Event("_call_function", {function:(() => (window["alert"]("message"))),callback:null})'
|
|
|
)
|
|
|
spec = event.window_alert(Var(_js_expr="message"))
|
|
|
assert (
|
|
|
format.format_event(spec)
|
|
|
- == 'Event("_call_function", {function:(() => (window["alert"](message)))})'
|
|
|
+ == 'Event("_call_function", {function:(() => (window["alert"](message))),callback:null})'
|
|
|
+ )
|
|
|
+ spec2 = event.window_alert(Var(_js_expr="message2")).add_args(Var("throwaway"))
|
|
|
+ assert (
|
|
|
+ format.format_event(spec2)
|
|
|
+ == 'Event("_call_function", {function:(() => (window["alert"](message2))),callback:null})'
|
|
|
)
|
|
|
|
|
|
|