Skip to content

Commit 4558279

Browse files
authored
refactor(material/list): switch tests away from fakeAsync (#33189)
Reworks the list tests not to depend on `fakeAsync`.
1 parent 60ed032 commit 4558279

2 files changed

Lines changed: 101 additions & 104 deletions

File tree

src/material/list/list.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
ViewChildren,
77
ChangeDetectionStrategy,
88
} from '@angular/core';
9-
import {TestBed, fakeAsync} from '@angular/core/testing';
9+
import {TestBed} from '@angular/core/testing';
1010
import {By} from '@angular/platform-browser';
1111
import {MatListItem, MatListModule} from './index';
1212

@@ -133,7 +133,7 @@ describe('MatList', () => {
133133
expect(activeItem.getAttribute('aria-current')).toBe('page');
134134
});
135135

136-
it('should not show ripples for non-nav lists', fakeAsync(() => {
136+
it('should not show ripples for non-nav lists', () => {
137137
const fixture = TestBed.createComponent(ListWithOneAnchorItem);
138138
fixture.detectChanges();
139139

@@ -144,7 +144,7 @@ describe('MatList', () => {
144144
dispatchMouseEvent(item._hostElement, 'mousedown');
145145
expect(fixture.nativeElement.querySelector('.mat-ripple-element')).toBe(null);
146146
});
147-
}));
147+
});
148148

149149
it('should allow disabling ripples for specific nav-list items', () => {
150150
const fixture = TestBed.createComponent(NavListWithOneAnchorItem);
@@ -252,7 +252,7 @@ describe('MatList', () => {
252252
expect(items.every(item => item.rippleDisabled)).toBe(true);
253253
});
254254

255-
it('should disable item ripples when list ripples are disabled via the input in nav list', fakeAsync(() => {
255+
it('should disable item ripples when list ripples are disabled via the input in nav list', () => {
256256
const fixture = TestBed.createComponent(NavListWithOneAnchorItem);
257257
fixture.detectChanges();
258258

@@ -285,9 +285,9 @@ describe('MatList', () => {
285285
expect(rippleTarget.querySelectorAll('.mat-ripple-element').length)
286286
.withContext('Expected no ripples after list ripples are disabled.')
287287
.toBe(0);
288-
}));
288+
});
289289

290-
it('should disable item ripples when list ripples are disabled via the input in an action list', fakeAsync(() => {
290+
it('should disable item ripples when list ripples are disabled via the input in an action list', () => {
291291
const fixture = TestBed.createComponent(ActionListWithoutType);
292292
fixture.detectChanges();
293293

@@ -320,7 +320,7 @@ describe('MatList', () => {
320320
expect(rippleTarget.querySelectorAll('.mat-ripple-element').length)
321321
.withContext('Expected no ripples after list ripples are disabled.')
322322
.toBe(0);
323-
}));
323+
});
324324

325325
it('should be able to disable a single list item', () => {
326326
const fixture = TestBed.createComponent(ListWithDisabledItems);

0 commit comments

Comments
 (0)