Skip to content

Commit cdd8e34

Browse files
authored
chore: reduce SauceLabs + Edge flakiness (#1216)
1 parent 8eca40b commit cdd8e34

File tree

14 files changed

+148
-185
lines changed

14 files changed

+148
-185
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
"node": ">= 4.2.1 < 5"
2424
},
2525
"dependencies": {
26-
"@angular/common": "2.0.0-rc.6",
27-
"@angular/compiler": "2.0.0-rc.6",
28-
"@angular/core": "2.0.0-rc.6",
29-
"@angular/forms": "2.0.0-rc.6",
30-
"@angular/http": "2.0.0-rc.6",
31-
"@angular/platform-browser": "2.0.0-rc.6",
32-
"@angular/platform-browser-dynamic": "2.0.0-rc.6",
33-
"@angular/router": "3.0.0-rc.2",
26+
"@angular/common": "^2.0.0",
27+
"@angular/compiler": "^2.0.0",
28+
"@angular/core": "^2.0.0",
29+
"@angular/forms": "^2.0.0",
30+
"@angular/http": "^2.0.0",
31+
"@angular/platform-browser": "^2.0.0",
32+
"@angular/platform-browser-dynamic": "^2.0.0",
33+
"@angular/router": "^3.0.0",
3434
"core-js": "^2.4.1",
3535
"hammerjs": "^2.0.8",
36-
"rxjs": "5.0.0-beta.11",
37-
"systemjs": "0.19.31",
38-
"zone.js": "0.6.17"
36+
"rxjs": "5.0.0-beta.12",
37+
"systemjs": "0.19.38",
38+
"zone.js": "^0.6.23"
3939
},
4040
"devDependencies": {
4141
"@angular/compiler-cli": "0.6.0",
@@ -71,7 +71,7 @@
7171
"merge2": "^1.0.2",
7272
"minimist": "^1.2.0",
7373
"node-sass": "^3.4.2",
74-
"protractor": "^3.3.0",
74+
"protractor": "^4.0.8",
7575
"protractor-accessibility-plugin": "0.1.1",
7676
"resolve-bin": "^0.4.0",
7777
"rollup": "^0.34.13",

src/lib/button-toggle/button-toggle.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('MdButtonToggle', () => {
4646
let buttonToggleInstances: MdButtonToggle[];
4747
let testComponent: ButtonTogglesInsideButtonToggleGroup;
4848

49-
beforeEach(async(() => {
49+
beforeEach(() => {
5050
fixture = TestBed.createComponent(ButtonTogglesInsideButtonToggleGroup);
5151
fixture.detectChanges();
5252

@@ -65,7 +65,7 @@ describe('MdButtonToggle', () => {
6565
.map(debugEl => debugEl.nativeElement);
6666

6767
buttonToggleInstances = buttonToggleDebugElements.map(debugEl => debugEl.componentInstance);
68-
}));
68+
});
6969

7070
it('should set individual button toggle names based on the group name', () => {
7171
expect(groupInstance.name).toBeTruthy();
@@ -326,7 +326,7 @@ describe('MdButtonToggle', () => {
326326

327327
describe('with initial value and change event', () => {
328328

329-
it('should not fire an initial change event', async(() => {
329+
it('should not fire an initial change event', () => {
330330
let fixture = TestBed.createComponent(ButtonToggleGroupWithInitialValue);
331331
let testComponent = fixture.debugElement.componentInstance;
332332
let groupDebugElement = fixture.debugElement.query(By.directive(MdButtonToggleGroup));
@@ -342,7 +342,7 @@ describe('MdButtonToggle', () => {
342342

343343
expect(groupInstance.value).toBe('green');
344344
expect(testComponent.lastEvent.value).toBe('green');
345-
}));
345+
});
346346

347347
});
348348

src/lib/checkbox/checkbox.spec.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('MdCheckbox', () => {
4545
let inputElement: HTMLInputElement;
4646
let labelElement: HTMLLabelElement;
4747

48-
beforeEach(async(() => {
48+
beforeEach(() => {
4949
fixture = TestBed.createComponent(SingleCheckbox);
5050
fixture.detectChanges();
5151

@@ -55,7 +55,7 @@ describe('MdCheckbox', () => {
5555
testComponent = fixture.debugElement.componentInstance;
5656
inputElement = <HTMLInputElement>checkboxNativeElement.querySelector('input');
5757
labelElement = <HTMLLabelElement>checkboxNativeElement.querySelector('label');
58-
}));
58+
});
5959

6060
it('should add and remove the checked state', () => {
6161
expect(checkboxInstance.checked).toBe(false);
@@ -318,7 +318,7 @@ describe('MdCheckbox', () => {
318318
let inputElement: HTMLInputElement;
319319
let labelElement: HTMLLabelElement;
320320

321-
beforeEach(async(() => {
321+
beforeEach(() => {
322322
fixture = TestBed.createComponent(CheckboxWithChangeEvent);
323323
fixture.detectChanges();
324324

@@ -328,7 +328,7 @@ describe('MdCheckbox', () => {
328328
testComponent = fixture.debugElement.componentInstance;
329329
inputElement = <HTMLInputElement>checkboxNativeElement.querySelector('input');
330330
labelElement = <HTMLLabelElement>checkboxNativeElement.querySelector('label');
331-
}));
331+
});
332332

333333
it('should emit the event to the change observable', () => {
334334
let changeSpy = jasmine.createSpy('onChangeObservable');
@@ -370,41 +370,41 @@ describe('MdCheckbox', () => {
370370
let checkboxNativeElement: HTMLElement;
371371
let inputElement: HTMLInputElement;
372372

373-
it('should use the provided aria-label', async(() => {
373+
it('should use the provided aria-label', () => {
374374
fixture = TestBed.createComponent(CheckboxWithAriaLabel);
375375
checkboxDebugElement = fixture.debugElement.query(By.directive(MdCheckbox));
376376
checkboxNativeElement = checkboxDebugElement.nativeElement;
377377
inputElement = <HTMLInputElement>checkboxNativeElement.querySelector('input');
378378

379379
fixture.detectChanges();
380380
expect(inputElement.getAttribute('aria-label')).toBe('Super effective');
381-
}));
381+
});
382382
});
383383

384384
describe('with provided aria-labelledby ', () => {
385385
let checkboxDebugElement: DebugElement;
386386
let checkboxNativeElement: HTMLElement;
387387
let inputElement: HTMLInputElement;
388388

389-
it('should use the provided aria-labelledby', async(() => {
389+
it('should use the provided aria-labelledby', () => {
390390
fixture = TestBed.createComponent(CheckboxWithAriaLabelledby);
391391
checkboxDebugElement = fixture.debugElement.query(By.directive(MdCheckbox));
392392
checkboxNativeElement = checkboxDebugElement.nativeElement;
393393
inputElement = <HTMLInputElement>checkboxNativeElement.querySelector('input');
394394

395395
fixture.detectChanges();
396396
expect(inputElement.getAttribute('aria-labelledby')).toBe('some-id');
397-
}));
397+
});
398398

399-
it('should not assign aria-labelledby if none is provided', async(() => {
399+
it('should not assign aria-labelledby if none is provided', () => {
400400
fixture = TestBed.createComponent(SingleCheckbox);
401401
checkboxDebugElement = fixture.debugElement.query(By.directive(MdCheckbox));
402402
checkboxNativeElement = checkboxDebugElement.nativeElement;
403403
inputElement = <HTMLInputElement>checkboxNativeElement.querySelector('input');
404404

405405
fixture.detectChanges();
406406
expect(inputElement.getAttribute('aria-labelledby')).toBe(null);
407-
}));
407+
});
408408
});
409409

410410
describe('with provided tabIndex', () => {
@@ -414,7 +414,7 @@ describe('MdCheckbox', () => {
414414
let inputElement: HTMLInputElement;
415415
let labelElement: HTMLLabelElement;
416416

417-
beforeEach(async(() => {
417+
beforeEach(() => {
418418
fixture = TestBed.createComponent(CheckboxWithTabIndex);
419419
fixture.detectChanges();
420420

@@ -423,11 +423,11 @@ describe('MdCheckbox', () => {
423423
checkboxNativeElement = checkboxDebugElement.nativeElement;
424424
inputElement = <HTMLInputElement>checkboxNativeElement.querySelector('input');
425425
labelElement = <HTMLLabelElement>checkboxNativeElement.querySelector('label');
426-
}));
426+
});
427427

428-
it('should preserve any given tabIndex', async(() => {
428+
it('should preserve any given tabIndex', () => {
429429
expect(inputElement.tabIndex).toBe(7);
430-
}));
430+
});
431431

432432
it('should preserve given tabIndex when the checkbox is disabled then enabled', () => {
433433
testComponent.isDisabled = true;
@@ -444,10 +444,10 @@ describe('MdCheckbox', () => {
444444
});
445445

446446
describe('with multiple checkboxes', () => {
447-
beforeEach(async(() => {
447+
beforeEach(() => {
448448
fixture = TestBed.createComponent(MultipleCheckboxes);
449449
fixture.detectChanges();
450-
}));
450+
});
451451

452452
it('should assign a unique id to each checkbox', () => {
453453
let [firstId, secondId] =
@@ -461,10 +461,10 @@ describe('MdCheckbox', () => {
461461
});
462462

463463
describe('with ngModel', () => {
464-
beforeEach(async(() => {
464+
beforeEach(() => {
465465
fixture = TestBed.createComponent(CheckboxWithFormDirectives);
466466
fixture.detectChanges();
467-
}));
467+
});
468468

469469
it('should be in pristine, untouched, and valid states initially', fakeAsync(() => {
470470
flushMicrotasks();
@@ -482,17 +482,17 @@ describe('MdCheckbox', () => {
482482
});
483483

484484
describe('with name attribute', () => {
485-
beforeEach(async(() => {
485+
beforeEach(() => {
486486
fixture = TestBed.createComponent(CheckboxWithNameAttribute);
487487
fixture.detectChanges();
488-
}));
488+
});
489489

490-
it('should forward name value to input element', fakeAsync(() => {
490+
it('should forward name value to input element', () => {
491491
let checkboxElement = fixture.debugElement.query(By.directive(MdCheckbox));
492492
let inputElement = <HTMLInputElement> checkboxElement.nativeElement.querySelector('input');
493493

494494
expect(inputElement.getAttribute('name')).toBe('test-name');
495-
}));
495+
});
496496
});
497497
});
498498

src/lib/core/overlay/overlay-directives.spec.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {async, fakeAsync, flushMicrotasks, ComponentFixture, TestBed} from '@angular/core/testing';
1+
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {Component, ViewChild} from '@angular/core';
33
import {ConnectedOverlayDirective, OverlayModule} from './overlay-directives';
44
import {OverlayContainer} from './overlay-container';
@@ -9,7 +9,7 @@ describe('Overlay directives', () => {
99
let overlayContainerElement: HTMLElement;
1010
let fixture: ComponentFixture<ConnectedOverlayDirectiveTest>;
1111

12-
beforeEach(async(() => {
12+
beforeEach(() => {
1313
TestBed.configureTestingModule({
1414
imports: [OverlayModule.forRoot()],
1515
declarations: [ConnectedOverlayDirectiveTest],
@@ -20,23 +20,22 @@ describe('Overlay directives', () => {
2020
}}
2121
],
2222
});
23-
}));
23+
});
2424

25-
beforeEach(async(() => {
25+
beforeEach(() => {
2626
fixture = TestBed.createComponent(ConnectedOverlayDirectiveTest);
2727
fixture.detectChanges();
28-
}));
28+
});
2929

3030
it(`should create an overlay and attach the directive's template`, () => {
3131
expect(overlayContainerElement.textContent).toContain('Menu content');
3232
});
3333

34-
it('should destroy the overlay when the directive is destroyed', fakeAsync(() => {
34+
it('should destroy the overlay when the directive is destroyed', () => {
3535
fixture.destroy();
36-
flushMicrotasks();
3736

3837
expect(overlayContainerElement.textContent.trim()).toBe('');
39-
}));
38+
});
4039

4140
it('should use a connected position strategy with a default set of positions', () => {
4241
let testComponent: ConnectedOverlayDirectiveTest =

0 commit comments

Comments
 (0)