Skip to content

Commit

Permalink
debug ios
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn committed Jun 29, 2017
1 parent 2ed81eb commit e6df5b0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib/core/ripple/ripple.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {dispatchMouseEvent} from '../testing/dispatch-events';
import {
MdRipple, MdRippleModule, MD_RIPPLE_GLOBAL_OPTIONS, RippleState, RippleGlobalOptions
} from './index';
import {Platform} from '@angular/cdk';


describe('MdRipple', () => {
let fixture: ComponentFixture<any>;
let rippleTarget: HTMLElement;
let originalBodyMargin: string | null;
let viewportRuler: ViewportRuler;
let platform: Platform;

/** Extracts the numeric value of a pixel size string like '123px'. */
const pxStringToFloat = s => parseFloat(s) || 0;
Expand All @@ -31,8 +33,9 @@ describe('MdRipple', () => {
});
});

beforeEach(inject([ViewportRuler], (ruler: ViewportRuler) => {
beforeEach(inject([ViewportRuler, Platform], (ruler: ViewportRuler, p: Platform) => {
viewportRuler = ruler;
platform = p;

// Set body margin to 0 during tests so it doesn't mess up position calculations.
originalBodyMargin = document.body.style.margin;
Expand All @@ -58,12 +61,9 @@ describe('MdRipple', () => {
});

it('sizes ripple to cover element', () => {
// In the iOS simulator (BrowserStack & SauceLabs), adding the content to the
// body causes karma's iframe for the test to stretch to fit that content once we attempt to
// scroll the page. Setting width / height / maxWidth / maxHeight on the iframe does not
// successfully constrain its size. As such, skip assertions in environments where the
// window size has changed since the start of the test.
if (window.innerWidth > startingWindowWidth || window.innerHeight > startingWindowHeight) {
// This test is consistently flaky on iOS vs. Safari on desktop (and all other browsers).
// Temporarily skip this test on iOS until we can determine the source of the flakiness.
if (platform.IOS) {
return;
}

Expand Down

0 comments on commit e6df5b0

Please sign in to comment.