@@ -6,13 +6,15 @@ import {dispatchMouseEvent} from '../testing/dispatch-events';
66import {
77 MdRipple , MdRippleModule , MD_RIPPLE_GLOBAL_OPTIONS , RippleState , RippleGlobalOptions
88} from './index' ;
9+ import { Platform } from '@angular/cdk' ;
910
1011
1112describe ( 'MdRipple' , ( ) => {
1213 let fixture : ComponentFixture < any > ;
1314 let rippleTarget : HTMLElement ;
1415 let originalBodyMargin : string | null ;
1516 let viewportRuler : ViewportRuler ;
17+ let platform : Platform ;
1618
1719 /** Extracts the numeric value of a pixel size string like '123px'. */
1820 const pxStringToFloat = s => parseFloat ( s ) || 0 ;
@@ -31,8 +33,9 @@ describe('MdRipple', () => {
3133 } ) ;
3234 } ) ;
3335
34- beforeEach ( inject ( [ ViewportRuler ] , ( ruler : ViewportRuler ) => {
36+ beforeEach ( inject ( [ ViewportRuler , Platform ] , ( ruler : ViewportRuler , p : Platform ) => {
3537 viewportRuler = ruler ;
38+ platform = p ;
3639
3740 // Set body margin to 0 during tests so it doesn't mess up position calculations.
3841 originalBodyMargin = document . body . style . margin ;
@@ -58,12 +61,9 @@ describe('MdRipple', () => {
5861 } ) ;
5962
6063 it ( 'sizes ripple to cover element' , ( ) => {
61- // In the iOS simulator (BrowserStack & SauceLabs), adding the content to the
62- // body causes karma's iframe for the test to stretch to fit that content once we attempt to
63- // scroll the page. Setting width / height / maxWidth / maxHeight on the iframe does not
64- // successfully constrain its size. As such, skip assertions in environments where the
65- // window size has changed since the start of the test.
66- if ( window . innerWidth > startingWindowWidth || window . innerHeight > startingWindowHeight ) {
64+ // This test is consistently flaky on iOS vs. Safari on desktop (and all other browsers).
65+ // Temporarily skip this test on iOS until we can determine the source of the flakiness.
66+ if ( platform . IOS ) {
6767 return ;
6868 }
6969
0 commit comments