Skip to content

Commit

Permalink
minimize diff
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Oct 18, 2024
1 parent 4c3612d commit 0436d42
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions packages/grid/test/keyboard-navigation.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -1314,29 +1314,6 @@ describe('keyboard navigation', () => {
flushGrid(grid);
});

it('should scroll focused row into view on arrow key', () => {
focusItem(0);
// Simulate real scrolling to get the virtualizer to render
// the focused item in a different element.
grid.$.table.scrollTop = grid.$.table.scrollHeight / 2;
flushGrid(grid);
down();
expect(getFocusedRowIndex(grid)).to.equal(1);
expect(getFocusedCellIndex(grid)).to.equal(0);
});

it('should scroll focused row into view on Tab', () => {
focusItem(0);
tabToHeader();
// Simulate real scrolling to get the virtualizer to render
// the focused item in a different element.
grid.$.table.scrollTop = grid.$.table.scrollHeight / 2;
flushGrid(grid);
tab();
expect(getFocusedRowIndex(grid)).to.equal(0);
expect(getFocusedCellIndex(grid)).to.equal(0);
});

it('should hide navigation mode when a focused row goes off screen', () => {
focusItem(0);
right();
Expand Down Expand Up @@ -1368,6 +1345,29 @@ describe('keyboard navigation', () => {

expect(grid.hasAttribute('navigating')).to.be.true;
});

it('should scroll focused row into view on arrow key', () => {
focusItem(0);
// Simulate real scrolling to get the virtualizer to render
// the focused item in a different element.
grid.$.table.scrollTop = grid.$.table.scrollHeight / 2;
flushGrid(grid);
down();
expect(getFocusedRowIndex(grid)).to.equal(1);
expect(getFocusedCellIndex(grid)).to.equal(0);
});

it('should scroll focused row into view on Tab', () => {
focusItem(0);
tabToHeader();
// Simulate real scrolling to get the virtualizer to render
// the focused item in a different element.
grid.$.table.scrollTop = grid.$.table.scrollHeight / 2;
flushGrid(grid);
tab();
expect(getFocusedRowIndex(grid)).to.equal(0);
expect(getFocusedCellIndex(grid)).to.equal(0);
});
});
});

Expand Down

0 comments on commit 0436d42

Please sign in to comment.