Skip to content

Commit

Permalink
chore(datagrid): fix virtual scroll PageDown/Page test
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbuhmann committed Dec 3, 2024
1 parent 6107962 commit 5fbbb27
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,22 @@ export default function (): void {
expect(document.activeElement).toBe(headerCheckboxCell);

grid.dispatchEvent(new KeyboardEvent('keydown', { code: 'PageDown' }));
// active checkbox input with ID clr-dg-row-cb364
expect(document.activeElement).toBe(grid.querySelectorAll('[type=checkbox]')[22]);
expect(document.activeElement.id).toBe('clr-dg-row-cb24');
expect(document.activeElement).toBe(grid.querySelectorAll('[type=checkbox]')[23]);

grid.dispatchEvent(new KeyboardEvent('keydown', { code: 'PageDown' }));
sleep();
fixture.whenStable();
fixture.whenRenderingDone();
// active checkbox input with ID clr-dg-row-cb383
expect(document.activeElement.id).toBe('clr-dg-row-cb42');
expect(document.activeElement).toBe(grid.querySelectorAll('[type=checkbox]')[41]);

grid.dispatchEvent(new KeyboardEvent('keydown', { code: 'PageUp' }));
sleep();
fixture.whenStable();
fixture.whenRenderingDone();
// active checkbox input with ID clr-dg-row-cb360
expect(document.activeElement).toBe(grid.querySelectorAll('[type=checkbox]')[19]);
expect(document.activeElement.id).toBe('clr-dg-row-cb19');
expect(document.activeElement).toBe(grid.querySelectorAll('[type=checkbox]')[18]);

flush();
flushMicrotasks();
Expand Down

0 comments on commit 5fbbb27

Please sign in to comment.