Skip to content

Commit 752d653

Browse files
committed
debug ios
1 parent 2ed81eb commit 752d653

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/lib/core/ripple/ripple.spec.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import {dispatchMouseEvent} from '../testing/dispatch-events';
66
import {
77
MdRipple, MdRippleModule, MD_RIPPLE_GLOBAL_OPTIONS, RippleState, RippleGlobalOptions
88
} from './index';
9+
import {Platform} from '@angular/cdk';
910

1011

1112
describe('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,10 @@ 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+
// TODO(jelbourn): determine the source of flakiness here
67+
if (platform.IOS) {
6768
return;
6869
}
6970

0 commit comments

Comments
 (0)