@@ -8,9 +8,12 @@ describe('scrollMode: if-needed (outside the scrollingElement bounding box)', ()
8
8
const actual = await page . evaluate ( ( ) => {
9
9
window . scrollTo ( 0 , 0 )
10
10
return window
11
- . computeScrollIntoView ( document . querySelector ( '.vertical-scroll .target' ) , {
12
- scrollMode : 'if-needed' ,
13
- } )
11
+ . computeScrollIntoView (
12
+ document . querySelector ( '.vertical-scroll .target' ) ,
13
+ {
14
+ scrollMode : 'if-needed' ,
15
+ }
16
+ )
14
17
. map ( window . mapActions )
15
18
} )
16
19
expect ( actual ) . toHaveLength ( 1 )
@@ -21,9 +24,12 @@ describe('scrollMode: if-needed (outside the scrollingElement bounding box)', ()
21
24
const actual = await page . evaluate ( ( ) => {
22
25
window . scrollTo ( 0 , 50 )
23
26
return window
24
- . computeScrollIntoView ( document . querySelector ( '.vertical-scroll .target' ) , {
25
- scrollMode : 'if-needed' ,
26
- } )
27
+ . computeScrollIntoView (
28
+ document . querySelector ( '.vertical-scroll .target' ) ,
29
+ {
30
+ scrollMode : 'if-needed' ,
31
+ }
32
+ )
27
33
. map ( window . mapActions )
28
34
} )
29
35
expect ( actual ) . toHaveLength ( 1 )
@@ -32,11 +38,14 @@ describe('scrollMode: if-needed (outside the scrollingElement bounding box)', ()
32
38
33
39
test ( 'completely in view' , async ( ) => {
34
40
const actual = await page . evaluate ( ( ) => {
35
- window . scrollTo ( 0 , window . innerHeight / 2 ) ;
41
+ window . scrollTo ( 0 , window . innerHeight / 2 )
36
42
return window
37
- . computeScrollIntoView ( document . querySelector ( '.vertical-scroll .target' ) , {
38
- scrollMode : 'if-needed' ,
39
- } )
43
+ . computeScrollIntoView (
44
+ document . querySelector ( '.vertical-scroll .target' ) ,
45
+ {
46
+ scrollMode : 'if-needed' ,
47
+ }
48
+ )
40
49
. map ( window . mapActions )
41
50
} )
42
51
expect ( actual ) . toHaveLength ( 0 )
@@ -47,9 +56,12 @@ describe('scrollMode: if-needed (outside the scrollingElement bounding box)', ()
47
56
const actual = await page . evaluate ( ( ) => {
48
57
window . scrollTo ( 0 , window . innerHeight + 50 )
49
58
return window
50
- . computeScrollIntoView ( document . querySelector ( '.vertical-scroll .target' ) , {
51
- scrollMode : 'if-needed' ,
52
- } )
59
+ . computeScrollIntoView (
60
+ document . querySelector ( '.vertical-scroll .target' ) ,
61
+ {
62
+ scrollMode : 'if-needed' ,
63
+ }
64
+ )
53
65
. map ( window . mapActions )
54
66
} )
55
67
expect ( actual ) . toHaveLength ( 1 )
@@ -60,9 +72,12 @@ describe('scrollMode: if-needed (outside the scrollingElement bounding box)', ()
60
72
const actual = await page . evaluate ( ( ) => {
61
73
window . scrollTo ( 0 , window . innerHeight + 100 )
62
74
return window
63
- . computeScrollIntoView ( document . querySelector ( '.vertical-scroll .target' ) , {
64
- scrollMode : 'if-needed' ,
65
- } )
75
+ . computeScrollIntoView (
76
+ document . querySelector ( '.vertical-scroll .target' ) ,
77
+ {
78
+ scrollMode : 'if-needed' ,
79
+ }
80
+ )
66
81
. map ( window . mapActions )
67
82
} )
68
83
expect ( actual ) . toHaveLength ( 1 )
@@ -75,9 +90,12 @@ describe('scrollMode: if-needed (outside the scrollingElement bounding box)', ()
75
90
const actual = await page . evaluate ( ( ) => {
76
91
window . scrollTo ( 0 , 0 )
77
92
return window
78
- . computeScrollIntoView ( document . querySelector ( '.horizontal-scroll .target' ) , {
79
- scrollMode : 'if-needed' ,
80
- } )
93
+ . computeScrollIntoView (
94
+ document . querySelector ( '.horizontal-scroll .target' ) ,
95
+ {
96
+ scrollMode : 'if-needed' ,
97
+ }
98
+ )
81
99
. map ( window . mapActions )
82
100
} )
83
101
expect ( actual ) . toHaveLength ( 1 )
@@ -88,9 +106,12 @@ describe('scrollMode: if-needed (outside the scrollingElement bounding box)', ()
88
106
const actual = await page . evaluate ( ( ) => {
89
107
window . scrollTo ( 50 , 0 )
90
108
return window
91
- . computeScrollIntoView ( document . querySelector ( '.horizontal-scroll .target' ) , {
92
- scrollMode : 'if-needed' ,
93
- } )
109
+ . computeScrollIntoView (
110
+ document . querySelector ( '.horizontal-scroll .target' ) ,
111
+ {
112
+ scrollMode : 'if-needed' ,
113
+ }
114
+ )
94
115
. map ( window . mapActions )
95
116
} )
96
117
expect ( actual ) . toHaveLength ( 1 )
@@ -99,11 +120,14 @@ describe('scrollMode: if-needed (outside the scrollingElement bounding box)', ()
99
120
100
121
test ( 'completely in view' , async ( ) => {
101
122
const actual = await page . evaluate ( ( ) => {
102
- window . scrollTo ( window . innerWidth / 2 , 0 ) ;
123
+ window . scrollTo ( window . innerWidth / 2 , 0 )
103
124
return window
104
- . computeScrollIntoView ( document . querySelector ( '.horizontal-scroll .target' ) , {
105
- scrollMode : 'if-needed' ,
106
- } )
125
+ . computeScrollIntoView (
126
+ document . querySelector ( '.horizontal-scroll .target' ) ,
127
+ {
128
+ scrollMode : 'if-needed' ,
129
+ }
130
+ )
107
131
. map ( window . mapActions )
108
132
} )
109
133
expect ( actual ) . toHaveLength ( 0 )
@@ -114,9 +138,12 @@ describe('scrollMode: if-needed (outside the scrollingElement bounding box)', ()
114
138
const actual = await page . evaluate ( ( ) => {
115
139
window . scrollTo ( window . innerWidth + 50 , 0 )
116
140
return window
117
- . computeScrollIntoView ( document . querySelector ( '.horizontal-scroll .target' ) , {
118
- scrollMode : 'if-needed' ,
119
- } )
141
+ . computeScrollIntoView (
142
+ document . querySelector ( '.horizontal-scroll .target' ) ,
143
+ {
144
+ scrollMode : 'if-needed' ,
145
+ }
146
+ )
120
147
. map ( window . mapActions )
121
148
} )
122
149
expect ( actual ) . toHaveLength ( 1 )
@@ -127,9 +154,12 @@ describe('scrollMode: if-needed (outside the scrollingElement bounding box)', ()
127
154
const actual = await page . evaluate ( ( ) => {
128
155
window . scrollTo ( window . innerWidth + 100 , 0 )
129
156
return window
130
- . computeScrollIntoView ( document . querySelector ( '.horizontal-scroll .target' ) , {
131
- scrollMode : 'if-needed' ,
132
- } )
157
+ . computeScrollIntoView (
158
+ document . querySelector ( '.horizontal-scroll .target' ) ,
159
+ {
160
+ scrollMode : 'if-needed' ,
161
+ }
162
+ )
133
163
. map ( window . mapActions )
134
164
} )
135
165
expect ( actual ) . toHaveLength ( 1 )
0 commit comments