1
1
import { expect } from '@vaadin/chai-plugins' ;
2
2
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' ;
4
4
import sinon from 'sinon' ;
5
5
import {
6
6
createItems ,
@@ -15,7 +15,7 @@ import {
15
15
describe ( 'keyboard navigation' , ( ) => {
16
16
let grid ;
17
17
18
- beforeEach ( ( ) => {
18
+ beforeEach ( async ( ) => {
19
19
grid = fixtureSync ( `
20
20
<vaadin-grid-pro>
21
21
<vaadin-grid-pro-edit-column path="name" header="Name"></vaadin-grid-pro-edit-column>
@@ -28,6 +28,8 @@ describe('keyboard navigation', () => {
28
28
} ;
29
29
30
30
grid . items = createItems ( ) ;
31
+ // Wait for vaadin-grid-appear animation to finish
32
+ await oneEvent ( grid , 'animationend' ) ;
31
33
flushGrid ( grid ) ;
32
34
} ) ;
33
35
@@ -93,8 +95,6 @@ describe('keyboard navigation', () => {
93
95
const secondCell = getContainerCell ( grid . $ . items , 2 , 0 ) ;
94
96
const spy = sinon . spy ( secondCell , 'focus' ) ;
95
97
await sendKeys ( { press : 'Enter' } ) ;
96
- // Wait for possible scroll to get the cell into view
97
- await nextFrame ( ) ;
98
98
expect ( spy . calledOnce ) . to . be . true ;
99
99
} ) ;
100
100
0 commit comments