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', () => {
210210 } ) ;
211211
212212 describe ( 'when page is scrolled' , ( ) => {
213+ const startingWindowWidth = window . innerWidth ;
214+ const startingWindowHeight = window . innerHeight ;
213215 var veryLargeElement : HTMLDivElement = document . createElement ( 'div' ) ;
214216 var pageScrollTop = 500 ;
215217 var pageScrollLeft = 500 ;
@@ -263,6 +265,16 @@ describe('MdRipple', () => {
263265 const expectedTop = top - expectedRadius ;
264266
265267 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+
266278 expect ( pxStringToFloat ( ripple . style . left ) ) . toBeCloseTo ( expectedLeft , 1 ) ;
267279 expect ( pxStringToFloat ( ripple . style . top ) ) . toBeCloseTo ( expectedTop , 1 ) ;
268280 expect ( pxStringToFloat ( ripple . style . width ) ) . toBeCloseTo ( 2 * expectedRadius , 1 ) ;
You can’t perform that action at this time.
0 commit comments