diff --git a/src/cdk/scrolling/virtual-scroll-viewport.spec.ts b/src/cdk/scrolling/virtual-scroll-viewport.spec.ts index d8638121f1f9..a93c705c5eb9 100644 --- a/src/cdk/scrolling/virtual-scroll-viewport.spec.ts +++ b/src/cdk/scrolling/virtual-scroll-viewport.spec.ts @@ -25,7 +25,7 @@ import { tick, waitForAsync, } from '@angular/core/testing'; -import {Subject, animationFrameScheduler} from 'rxjs'; +import {Subject} from 'rxjs'; import {dispatchFakeEvent} from '../testing/private'; describe('CdkVirtualScrollViewport', () => { @@ -1245,7 +1245,7 @@ function finishInit(fixture: ComponentFixture) { flush(); // Flush the initial fake scroll event. - animationFrameScheduler.flush(); + tick(16); // flush animation frame; flush(); fixture.changeDetectorRef.markForCheck(); fixture.detectChanges(); @@ -1257,7 +1257,7 @@ function triggerScroll(viewport: CdkVirtualScrollViewport, offset?: number) { viewport.scrollToOffset(offset); } dispatchFakeEvent(viewport.scrollable.getElementRef().nativeElement, 'scroll'); - animationFrameScheduler.flush(); + tick(16); // flush animation frame; } @Component({