Skip to content

Commit e02322e

Browse files
committed
Change 'platform.SAFARI || platform.EDGE || platform.FIREFOX' to '!platform.IS_TRIDENT'
1 parent fb03706 commit e02322e

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/lib/list/selection-list.spec.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {async, TestBed, ComponentFixture} from '@angular/core/testing';
1+
import {async, TestBed, ComponentFixture, inject} from '@angular/core/testing';
22
import {Component, DebugElement} from '@angular/core';
33
import {By} from '@angular/platform-browser';
44
import {MdSelectionList, MdListOption, MdListModule} from './index';
@@ -169,6 +169,7 @@ describe('test selection list with single option', () => {
169169
let listOption: DebugElement;
170170
let listItemEl: DebugElement;
171171
let selectionList: DebugElement;
172+
let platform: Platform;
172173

173174
beforeEach(async(() => {
174175
TestBed.configureTestingModule({
@@ -192,12 +193,16 @@ describe('test selection list with single option', () => {
192193
fixture.detectChanges();
193194
}));
194195

196+
beforeEach(inject([Platform], (p: Platform) => {
197+
platform = p;
198+
}));
199+
195200
it('should be focused when focus on nativeElements', () => {
196201
listOption.nativeElement.focus();
197202
fixture.detectChanges();
198203

199204
expect(listItemEl.nativeElement).toBe(document.activeElement);
200-
if (!fixture.componentInstance.isIE) {
205+
if (!platform.IS_TRIDENT) {
201206
expect(listItemEl.nativeElement.className).toContain('mat-list-item-focus');
202207
}
203208

@@ -345,12 +350,4 @@ class SelectionListWithListDisabled {
345350
</md-list-option>
346351
</mat-selection-list>`})
347352
class SelectionListWithOnlyOneOption {
348-
isIE: boolean = true;
349-
constructor(public platform: Platform) {
350-
if (platform.SAFARI || platform.EDGE || platform.FIREFOX) {
351-
this.isIE = false;
352-
} else {
353-
this.isIE = true;
354-
}
355-
}
356353
}

0 commit comments

Comments
 (0)