From 28ec6d44164adfb1125521113f6072a735507ff4 Mon Sep 17 00:00:00 2001 From: Vaadin Bot Date: Wed, 29 Jan 2025 10:50:15 +0100 Subject: [PATCH] test: stabilize grid-pro keyboard test (#8585) (#8586) Co-authored-by: Sergey Vinogradov --- packages/grid-pro/test/keyboard-navigation.common.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/grid-pro/test/keyboard-navigation.common.js b/packages/grid-pro/test/keyboard-navigation.common.js index debbb0aae94..c7ae7cc5785 100644 --- a/packages/grid-pro/test/keyboard-navigation.common.js +++ b/packages/grid-pro/test/keyboard-navigation.common.js @@ -1,6 +1,6 @@ import { expect } from '@vaadin/chai-plugins'; import { sendKeys } from '@vaadin/test-runner-commands'; -import { aTimeout, fixtureSync, nextFrame } from '@vaadin/testing-helpers'; +import { aTimeout, fixtureSync, nextFrame, oneEvent } from '@vaadin/testing-helpers'; import sinon from 'sinon'; import { createItems, @@ -15,7 +15,7 @@ import { describe('keyboard navigation', () => { let grid; - beforeEach(() => { + beforeEach(async () => { grid = fixtureSync(` @@ -28,6 +28,8 @@ describe('keyboard navigation', () => { }; grid.items = createItems(); + // Wait for vaadin-grid-appear animation to finish + await oneEvent(grid, 'animationend'); flushGrid(grid); }); @@ -93,8 +95,6 @@ describe('keyboard navigation', () => { const secondCell = getContainerCell(grid.$.items, 2, 0); const spy = sinon.spy(secondCell, 'focus'); await sendKeys({ press: 'Enter' }); - // Wait for possible scroll to get the cell into view - await nextFrame(); expect(spy.calledOnce).to.be.true; });