From 05d98e375e4a8deaf4a3c35e9d1f17791ca66a5e Mon Sep 17 00:00:00 2001 From: Vaadin Bot Date: Thu, 9 Jan 2025 10:03:33 +0100 Subject: [PATCH] test: replace flushGrid with nextFrame to fix local failure in Firefox (#8457) (#8463) Co-authored-by: Sergey Vinogradov --- .../grid/test/keyboard-navigation-row-focus.common.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/grid/test/keyboard-navigation-row-focus.common.js b/packages/grid/test/keyboard-navigation-row-focus.common.js index 96adf141761..9610cc79921 100644 --- a/packages/grid/test/keyboard-navigation-row-focus.common.js +++ b/packages/grid/test/keyboard-navigation-row-focus.common.js @@ -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(); @@ -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(); @@ -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);