Skip to content

Commit

Permalink
fix(test): add the test case for scrolling by index and key
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatpandac committed Dec 27, 2023
1 parent aac3ae0 commit c93290a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/refs.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,17 @@ describe('Table.Ref', () => {
});

expect(scrollParam.top).toEqual(903);

// Scroll index
ref.current.scrollTo({
index: 0,
});
expect(scrollParam.top).toEqual(0);

// Scroll key
ref.current.scrollTo({
key: 'bamboo',
});
expect(scrollParam.top).toEqual(0);
});
});

0 comments on commit c93290a

Please sign in to comment.