Skip to content

Commit 0738a75

Browse files
committed
fixup! build: update cross-repo angular dependencies
1 parent 4b9af8c commit 0738a75

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cdk/scrolling/virtual-scroll-viewport.zone.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import {
2-
ApplicationRef,
32
Component,
3+
Injector,
44
NgZone,
55
TrackByFunction,
66
ViewChild,
77
ViewEncapsulation,
8+
afterNextRender,
89
provideZoneChangeDetection,
910
} from '@angular/core';
1011
import {ComponentFixture, TestBed, fakeAsync, flush, waitForAsync} from '@angular/core/testing';
@@ -40,20 +41,20 @@ describe('CdkVirtualScrollViewport Zone.js intergation', () => {
4041

4142
describe('viewChange change detection behavior', () => {
4243
it('should run change detection if there are any viewChange listeners', fakeAsync(() => {
43-
const appRef = TestBed.inject(ApplicationRef);
4444
testComponent.virtualForOf.viewChange.subscribe();
4545
finishInit(fixture);
4646
testComponent.items = Array(10).fill(0);
4747
fixture.changeDetectorRef.markForCheck();
4848
fixture.detectChanges();
4949
flush();
5050

51-
spyOn(appRef, 'tick');
51+
const spy = jasmine.createSpy();
52+
afterNextRender(spy, {injector: TestBed.inject(Injector)});
5253

5354
viewport.scrollToIndex(5);
5455
triggerScroll(viewport);
5556

56-
expect(appRef.tick).toHaveBeenCalledTimes(1);
57+
expect(spy).toHaveBeenCalledTimes(1);
5758
}));
5859
});
5960
});

0 commit comments

Comments
 (0)