Skip to content

Commit 4cd40e8

Browse files
crisbetongwattcos
authored andcommitted
test(material-experimental/mdc-slider): try to reduce test flakes (angular#19987)
We've been seeing more test flakes from the MDC slider recently. These changes try to address them by disabling animations and adding an extra change detection after flushing `requestAnimationFrame`.
1 parent 6270b43 commit 4cd40e8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/material-experimental/mdc-slider/slider.spec.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,19 @@ import {Component, DebugElement, Type, ViewChild} from '@angular/core';
2424
import {ComponentFixture, fakeAsync, flush, TestBed, tick, inject} from '@angular/core/testing';
2525
import {FormControl, FormsModule, ReactiveFormsModule} from '@angular/forms';
2626
import {By} from '@angular/platform-browser';
27+
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
2728
import {MatSlider, MatSliderModule} from './index';
2829

2930
describe('MDC-based MatSlider', () => {
3031
function createComponent<T>(component: Type<T>): ComponentFixture<T> {
3132
TestBed.configureTestingModule({
32-
imports: [MatSliderModule, ReactiveFormsModule, FormsModule, BidiModule],
33+
imports: [
34+
MatSliderModule,
35+
ReactiveFormsModule,
36+
FormsModule,
37+
BidiModule,
38+
NoopAnimationsModule,
39+
],
3340
declarations: [component],
3441
}).compileComponents();
3542

0 commit comments

Comments
 (0)