@@ -157,6 +157,47 @@ describe('BlockScrollStrategy', () => {
157
157
} ) ,
158
158
) ;
159
159
160
+ it (
161
+ `should't do anything if the page isn't scrollable while zoomed out` ,
162
+ skipIOS ( ( ) => {
163
+ forceScrollElement . style . display = 'none' ;
164
+ document . body . style . zoom = '75%' ;
165
+ overlayRef . attach ( componentPortal ) ;
166
+ expect ( document . body . scrollWidth ) . toBeGreaterThan ( window . innerWidth ) ;
167
+ expect ( documentElement . classList ) . not . toContain ( 'cdk-global-scrollblock' ) ;
168
+ overlayRef . detach ( ) ;
169
+ document . body . style . zoom = '100%' ;
170
+
171
+ document . documentElement . style . zoom = '75%' ;
172
+ overlayRef . attach ( componentPortal ) ;
173
+ expect ( document . body . scrollWidth ) . toBeGreaterThan ( window . innerWidth ) ;
174
+ expect ( documentElement . classList ) . not . toContain ( 'cdk-global-scrollblock' ) ;
175
+ document . documentElement . style . zoom = '100%' ;
176
+ } ) ,
177
+ ) ;
178
+
179
+ it (
180
+ `should add cdk-global-scrollblock while zoomed in` ,
181
+ skipIOS ( ( ) => {
182
+ forceScrollElement . style . width = window . innerWidth - 20 + 'px' ;
183
+ forceScrollElement . style . height = window . innerHeight - 20 + 'px' ;
184
+ overlayRef . attach ( componentPortal ) ;
185
+ expect ( documentElement . classList ) . not . toContain ( 'cdk-global-scrollblock' ) ;
186
+ overlayRef . detach ( ) ;
187
+
188
+ document . body . style . zoom = '200%' ;
189
+ overlayRef . attach ( componentPortal ) ;
190
+ expect ( documentElement . classList ) . toContain ( 'cdk-global-scrollblock' ) ;
191
+ document . body . style . zoom = '100%' ;
192
+ overlayRef . detach ( ) ;
193
+
194
+ document . documentElement . style . zoom = '200%' ;
195
+ overlayRef . attach ( componentPortal ) ;
196
+ expect ( documentElement . classList ) . toContain ( 'cdk-global-scrollblock' ) ;
197
+ document . documentElement . style . zoom = '100%' ;
198
+ } ) ,
199
+ ) ;
200
+
160
201
it ( 'should keep the content width' , ( ) => {
161
202
forceScrollElement . style . width = '100px' ;
162
203
0 commit comments