@@ -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
5235async def test_script_from_src (display : DisplayFixture ):
0 commit comments