MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / testHelper

Function testHelper

lib/utils/getUpdatedOffsetForIndex.test.ts:6–17  ·  view source on GitHub ↗
(
    targetIndex: number,
    currentOffset: number,
    cellMetadata = getCellMetadata()
  )

Source from the content-addressed store, hash-verified

4
5describe("getUpdatedOffsetForIndex", () => {
6 function testHelper(
7 targetIndex: number,
8 currentOffset: number,
9 cellMetadata = getCellMetadata()
10 ) {
11 return getUpdatedOffsetForIndex({
12 cellOffset: cellMetadata[targetIndex].offset,
13 cellSize: cellMetadata[targetIndex].size,
14 containerSize: 50,
15 currentOffset
16 });
17 }
18
19 it("should scroll to the beginning", () => {
20 expect(testHelper(0, 100)).toEqual(0);

Calls 2

getCellMetadataFunction · 0.90
getUpdatedOffsetForIndexFunction · 0.90

Tested by

no test coverage detected