Fix tests
This commit is contained in:
parent
31462ad14d
commit
437d421afe
@ -6,7 +6,6 @@ import reflex as rx
|
|||||||
from reflex.components.core.debounce import DEFAULT_DEBOUNCE_TIMEOUT
|
from reflex.components.core.debounce import DEFAULT_DEBOUNCE_TIMEOUT
|
||||||
from reflex.state import BaseState
|
from reflex.state import BaseState
|
||||||
from reflex.vars.base import LiteralVar, Var
|
from reflex.vars.base import LiteralVar, Var
|
||||||
from reflex.vars.number import ternary_operation
|
|
||||||
|
|
||||||
|
|
||||||
def test_create_no_child():
|
def test_create_no_child():
|
||||||
@ -61,14 +60,7 @@ def test_render_child_props():
|
|||||||
assert "css" in tag.props and isinstance(tag.props["css"], rx.vars.Var)
|
assert "css" in tag.props and isinstance(tag.props["css"], rx.vars.Var)
|
||||||
for prop in ["foo", "bar", "baz", "quuc"]:
|
for prop in ["foo", "bar", "baz", "quuc"]:
|
||||||
assert prop in str(tag.props["css"])
|
assert prop in str(tag.props["css"])
|
||||||
value_var = Var.create("real")
|
assert tag.props["value"].equals(LiteralVar.create("real"))
|
||||||
assert tag.props["value"].equals(
|
|
||||||
ternary_operation(
|
|
||||||
(value_var != Var.create(None)) & (value_var != Var(_js_expr="undefined")),
|
|
||||||
"real",
|
|
||||||
"",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
assert len(tag.props["onChange"].events) == 1
|
assert len(tag.props["onChange"].events) == 1
|
||||||
assert tag.props["onChange"].events[0].handler == S.on_change
|
assert tag.props["onChange"].events[0].handler == S.on_change
|
||||||
assert tag.contents == ""
|
assert tag.contents == ""
|
||||||
|
Loading…
Reference in New Issue
Block a user