Skip to content

Commit fd0964f

Browse files
committed
Fix test to account for removal of unmount
1 parent 93a1d0a commit fd0964f

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/py/reactpy/tests/test_html.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,9 @@ def HasScript():
1414
count, incr_count.current = use_counter(1)
1515
return html.div(
1616
html.div({"id": "mount-count", "data_value": 0}),
17-
html.div({"id": "unmount-count", "data_value": 0}),
1817
html.script(
19-
f"""() => {{
20-
const mountCountEl = document.getElementById("mount-count");
21-
const unmountCountEl = document.getElementById("unmount-count");
22-
mountCountEl.setAttribute("data-value", {count});
23-
return () => unmountCountEl.setAttribute("data-value", {count});;
24-
}}"""
18+
'const mountCountEl = document.getElementById("mount-count");'
19+
f'mountCountEl.setAttribute("data-value", {count});'
2520
),
2621
)
2722

@@ -30,23 +25,11 @@ def HasScript():
3025
mount_count = await display.page.wait_for_selector("#mount-count", state="attached")
3126
poll_mount_count = poll(mount_count.get_attribute, "data-value")
3227

33-
unmount_count = await display.page.wait_for_selector(
34-
"#unmount-count", state="attached"
35-
)
36-
poll_unmount_count = poll(unmount_count.get_attribute, "data-value")
37-
3828
await poll_mount_count.until_equals("1")
39-
await poll_unmount_count.until_equals("0")
40-
4129
incr_count.current()
42-
4330
await poll_mount_count.until_equals("2")
44-
await poll_unmount_count.until_equals("1")
45-
4631
incr_count.current()
47-
4832
await poll_mount_count.until_equals("3")
49-
await poll_unmount_count.until_equals("2")
5033

5134

5235
async def test_script_from_src(display: DisplayFixture):

0 commit comments

Comments
 (0)