@@ -14,14 +14,9 @@ def HasScript():
14
14
count , incr_count .current = use_counter (1 )
15
15
return html .div (
16
16
html .div ({"id" : "mount-count" , "data_value" : 0 }),
17
- html .div ({"id" : "unmount-count" , "data_value" : 0 }),
18
17
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 } );'
25
20
),
26
21
)
27
22
@@ -30,23 +25,11 @@ def HasScript():
30
25
mount_count = await display .page .wait_for_selector ("#mount-count" , state = "attached" )
31
26
poll_mount_count = poll (mount_count .get_attribute , "data-value" )
32
27
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
-
38
28
await poll_mount_count .until_equals ("1" )
39
- await poll_unmount_count .until_equals ("0" )
40
-
41
29
incr_count .current ()
42
-
43
30
await poll_mount_count .until_equals ("2" )
44
- await poll_unmount_count .until_equals ("1" )
45
-
46
31
incr_count .current ()
47
-
48
32
await poll_mount_count .until_equals ("3" )
49
- await poll_unmount_count .until_equals ("2" )
50
33
51
34
52
35
async def test_script_from_src (display : DisplayFixture ):
0 commit comments