Skip to content

fix strict eq effect test #1170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/py/reactpy/tests/test_core/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ def SomeComponent():
@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
Expand All @@ -1217,7 +1217,7 @@ def incr_effect_count():
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
Expand Down