Skip to content

Commit 28ec6d4

Browse files
vaadin-botvursen
andauthored
test: stabilize grid-pro keyboard test (#8585) (#8586)
Co-authored-by: Sergey Vinogradov <[email protected]>
1 parent ba53627 commit 28ec6d4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/grid-pro/test/keyboard-navigation.common.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from '@vaadin/chai-plugins';
22
import { sendKeys } from '@vaadin/test-runner-commands';
3-
import { aTimeout, fixtureSync, nextFrame } from '@vaadin/testing-helpers';
3+
import { aTimeout, fixtureSync, nextFrame, oneEvent } from '@vaadin/testing-helpers';
44
import sinon from 'sinon';
55
import {
66
createItems,
@@ -15,7 +15,7 @@ import {
1515
describe('keyboard navigation', () => {
1616
let grid;
1717

18-
beforeEach(() => {
18+
beforeEach(async () => {
1919
grid = fixtureSync(`
2020
<vaadin-grid-pro>
2121
<vaadin-grid-pro-edit-column path="name" header="Name"></vaadin-grid-pro-edit-column>
@@ -28,6 +28,8 @@ describe('keyboard navigation', () => {
2828
};
2929

3030
grid.items = createItems();
31+
// Wait for vaadin-grid-appear animation to finish
32+
await oneEvent(grid, 'animationend');
3133
flushGrid(grid);
3234
});
3335

@@ -93,8 +95,6 @@ describe('keyboard navigation', () => {
9395
const secondCell = getContainerCell(grid.$.items, 2, 0);
9496
const spy = sinon.spy(secondCell, 'focus');
9597
await sendKeys({ press: 'Enter' });
96-
// Wait for possible scroll to get the cell into view
97-
await nextFrame();
9898
expect(spy.calledOnce).to.be.true;
9999
});
100100

0 commit comments

Comments
 (0)