Skip to content

Commit

Permalink
test: replace flushGrid with nextFrame to fix local failure in Firefox (
Browse files Browse the repository at this point in the history
#8457) (#8463)

Co-authored-by: Sergey Vinogradov <[email protected]>
  • Loading branch information
vaadin-bot and vursen authored Jan 9, 2025
1 parent d8820ac commit 05d98e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/grid/test/keyboard-navigation-row-focus.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe('keyboard navigation - row focus', () => {
});

describe('scrolling and navigating', () => {
it('should scroll focused nested row into view on arrow key', () => {
it('should scroll focused nested row into view on arrow key', async () => {
focusItem(0);
// Expand first row
right();
Expand All @@ -153,12 +153,12 @@ describe('keyboard navigation - row focus', () => {
// 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);
await nextFrame();
down();
expect(getFocusedRowIndex(grid)).to.equal(2);
});

it('should scroll focused nested row into view on Tab', () => {
it('should scroll focused nested row into view on Tab', async () => {
focusItem(0);
// Expand first row
right();
Expand All @@ -169,7 +169,7 @@ describe('keyboard navigation - row focus', () => {
// 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);
await nextFrame();
// Move focus back to items
tab();
expect(getFocusedRowIndex(grid)).to.equal(1);
Expand Down

0 comments on commit 05d98e3

Please sign in to comment.