File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,8 @@ describe('MdRipple', () => {
210
210
} ) ;
211
211
212
212
describe ( 'when page is scrolled' , ( ) => {
213
+ const startingWindowWidth = window . innerWidth ;
214
+ const startingWindowHeight = window . innerHeight ;
213
215
var veryLargeElement : HTMLDivElement = document . createElement ( 'div' ) ;
214
216
var pageScrollTop = 500 ;
215
217
var pageScrollLeft = 500 ;
@@ -263,6 +265,16 @@ describe('MdRipple', () => {
263
265
const expectedTop = top - expectedRadius ;
264
266
265
267
const ripple = < HTMLElement > rippleElement . querySelector ( '.md-ripple-foreground' ) ;
268
+
269
+ // In the iOS simulator (BrowserStack & SauceLabs), adding the content to the
270
+ // body causes karma's iframe for the test to stretch to fit that content once we attempt to
271
+ // scroll the page. Setting width / height / maxWidth / maxHeight on the iframe does not
272
+ // successfully constrain its size. As such, skip assertions in environments where the
273
+ // window size has changed since the start of the test.
274
+ if ( window . innerWidth > startingWindowWidth || window . innerHeight > startingWindowHeight ) {
275
+ return ;
276
+ }
277
+
266
278
expect ( pxStringToFloat ( ripple . style . left ) ) . toBeCloseTo ( expectedLeft , 1 ) ;
267
279
expect ( pxStringToFloat ( ripple . style . top ) ) . toBeCloseTo ( expectedTop , 1 ) ;
268
280
expect ( pxStringToFloat ( ripple . style . width ) ) . toBeCloseTo ( 2 * expectedRadius , 1 ) ;
You can’t perform that action at this time.
0 commit comments