MCPcopy Create free account
hub / github.com/angular/components / triggerScroll

Function triggerScroll

src/cdk/table/table.spec.ts:2064–2072  ·  view source on GitHub ↗
(
      fixture: ComponentFixture<{viewport: CdkVirtualScrollViewport}>,
      offset: number,
    )

Source from the content-addressed store, hash-verified

2062 }
2063
2064 async function triggerScroll(
2065 fixture: ComponentFixture<{viewport: CdkVirtualScrollViewport}>,
2066 offset: number,
2067 ) {
2068 const viewport = fixture.componentInstance.viewport;
2069 viewport.scrollToOffset(offset);
2070 dispatchFakeEvent(viewport.scrollable!.getElementRef().nativeElement, 'scroll');
2071 await new Promise(resolve => setTimeout(resolve, 50));
2072 }
2073
2074 it('should not render the full data set when using virtual scrolling', async () => {
2075 const {fixture, table} = await createVirtualScroll(TableWithVirtualScroll);

Callers 1

table.spec.tsFile · 0.70

Calls 3

dispatchFakeEventFunction · 0.85
scrollToOffsetMethod · 0.80
getElementRefMethod · 0.65

Tested by

no test coverage detected