@@ -18,6 +18,9 @@ describe('MdRipple', () => {
18
18
let originalBodyMargin : string ;
19
19
let viewportRuler : ViewportRuler ;
20
20
21
+ const startingWindowWidth = window . innerWidth ;
22
+ const startingWindowHeight = window . innerHeight ;
23
+
21
24
beforeEach ( ( ) => {
22
25
TestBed . configureTestingModule ( {
23
26
imports : [ MdRippleModule ] ,
@@ -57,6 +60,15 @@ describe('MdRipple', () => {
57
60
} ) ;
58
61
59
62
it ( 'sizes ripple to cover element' , ( ) => {
63
+ // In the iOS simulator (BrowserStack & SauceLabs), adding the content to the
64
+ // body causes karma's iframe for the test to stretch to fit that content once we attempt to
65
+ // scroll the page. Setting width / height / maxWidth / maxHeight on the iframe does not
66
+ // successfully constrain its size. As such, skip assertions in environments where the
67
+ // window size has changed since the start of the test.
68
+ if ( window . innerWidth > startingWindowWidth || window . innerHeight > startingWindowHeight ) {
69
+ return ;
70
+ }
71
+
60
72
let elementRect = rippleTarget . getBoundingClientRect ( ) ;
61
73
62
74
// Dispatch a ripple at the following relative coordinates (X: 50| Y: 75)
@@ -192,9 +204,6 @@ describe('MdRipple', () => {
192
204
} ) ;
193
205
194
206
describe ( 'when page is scrolled' , ( ) => {
195
- const startingWindowWidth = window . innerWidth ;
196
- const startingWindowHeight = window . innerHeight ;
197
-
198
207
let veryLargeElement : HTMLDivElement = document . createElement ( 'div' ) ;
199
208
let pageScrollTop = 500 ;
200
209
let pageScrollLeft = 500 ;
0 commit comments