@@ -6,13 +6,15 @@ import {dispatchMouseEvent} from '../testing/dispatch-events';
6
6
import {
7
7
MdRipple , MdRippleModule , MD_RIPPLE_GLOBAL_OPTIONS , RippleState , RippleGlobalOptions
8
8
} from './index' ;
9
+ import { Platform } from '@angular/cdk' ;
9
10
10
11
11
12
describe ( 'MdRipple' , ( ) => {
12
13
let fixture : ComponentFixture < any > ;
13
14
let rippleTarget : HTMLElement ;
14
15
let originalBodyMargin : string | null ;
15
16
let viewportRuler : ViewportRuler ;
17
+ let platform : Platform ;
16
18
17
19
/** Extracts the numeric value of a pixel size string like '123px'. */
18
20
const pxStringToFloat = s => parseFloat ( s ) || 0 ;
@@ -31,8 +33,9 @@ describe('MdRipple', () => {
31
33
} ) ;
32
34
} ) ;
33
35
34
- beforeEach ( inject ( [ ViewportRuler ] , ( ruler : ViewportRuler ) => {
36
+ beforeEach ( inject ( [ ViewportRuler , Platform ] , ( ruler : ViewportRuler , p : Platform ) => {
35
37
viewportRuler = ruler ;
38
+ platform = p ;
36
39
37
40
// Set body margin to 0 during tests so it doesn't mess up position calculations.
38
41
originalBodyMargin = document . body . style . margin ;
@@ -58,12 +61,9 @@ describe('MdRipple', () => {
58
61
} ) ;
59
62
60
63
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 ) {
67
67
return ;
68
68
}
69
69
0 commit comments