fix strict eq effect test (#1170)

This commit is contained in:
Ryan Morshead 2023-12-09 19:07:31 -07:00 committed by GitHub
parent d6f9bfe23c
commit 43009e42fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1204,7 +1204,7 @@ async def test_use_state_compares_with_strict_equality(get_value):
@pytest.mark.parametrize("get_value", STRICT_EQUALITY_VALUE_CONSTRUCTORS)
async def test_use_effect_compares_with_strict_equality(get_value):
effect_count = reactpy.Ref(0)
value = reactpy.Ref("string")
value = reactpy.Ref(get_value())
hook = HookCatcher()
@reactpy.component
@ -1217,7 +1217,7 @@ async def test_use_effect_compares_with_strict_equality(get_value):
async with reactpy.Layout(SomeComponent()) as layout:
await layout.render()
assert effect_count.current == 1
value.current = "string" # new string instance but same value
value.current = get_value()
hook.latest.schedule_render()
await layout.render()
# effect does not trigger