Skip to content

Commit

Permalink
test: stabilize grid-pro keyboard test (#8585)
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen authored Jan 29, 2025
1 parent 3eef437 commit 63e087a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/grid-pro/test/keyboard-navigation.common.js
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -15,7 +15,7 @@ import {
describe('keyboard navigation', () => {
let grid;

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

grid.items = createItems();
// Wait for vaadin-grid-appear animation to finish
await oneEvent(grid, 'animationend');
flushGrid(grid);
});

Expand Down Expand Up @@ -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;
});

Expand Down

0 comments on commit 63e087a

Please sign in to comment.