From 83aef9a4caa6677b1772c3fa41fecc20e9506620 Mon Sep 17 00:00:00 2001 From: Vaadin Bot Date: Wed, 18 Oct 2023 09:46:01 +0200 Subject: [PATCH] test: fix a grid pro test case (#6665) (#6666) Co-authored-by: Tomi Virkki --- packages/grid-pro/test/edit-column.test.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/grid-pro/test/edit-column.test.js b/packages/grid-pro/test/edit-column.test.js index d2c886fb2f..0a860b4db3 100644 --- a/packages/grid-pro/test/edit-column.test.js +++ b/packages/grid-pro/test/edit-column.test.js @@ -1,6 +1,5 @@ import { expect } from '@esm-bundle/chai'; import { enter, fixtureSync, focusin, focusout, isIOS, tab } from '@vaadin/testing-helpers'; -import { sendKeys } from '@web/test-runner-commands'; import sinon from 'sinon'; import '../vaadin-grid-pro.js'; import '../vaadin-grid-pro-edit-column.js'; @@ -43,33 +42,29 @@ describe('edit column', () => { checkboxCell = getContainerCell(grid.$.items, 1, 2); }); - it('should focus cell next available for editing in edit mode on Tab', async () => { + it('should focus cell next available for editing in edit mode on Tab', () => { dblclick(textCell._content); expect(getCellEditor(textCell)).to.be.ok; // Press Tab to edit the select cell - await sendKeys({ press: 'Tab' }); + tab(document.activeElement); expect(getCellEditor(selectCell)).to.be.ok; // Press Tab to edit the checkbox cell - await sendKeys({ press: 'Tab' }); + tab(document.activeElement); expect(getCellEditor(checkboxCell)).to.be.ok; }); - it('should focus previous cell available for editing in edit mode on Shift Tab', async () => { + it('should focus previous cell available for editing in edit mode on Shift Tab', () => { dblclick(checkboxCell._content); expect(getCellEditor(checkboxCell)).to.be.ok; // Press Shift + Tab to edit the select cell - await sendKeys({ down: 'Shift' }); - await sendKeys({ press: 'Tab' }); - await sendKeys({ up: 'Shift' }); + tab(document.activeElement, ['shift']); expect(getCellEditor(selectCell)).to.be.ok; // Press Shift + Tab to edit the text cell - await sendKeys({ down: 'Shift' }); - await sendKeys({ press: 'Tab' }); - await sendKeys({ up: 'Shift' }); + tab(document.activeElement, ['shift']); expect(getCellEditor(textCell)).to.be.ok; }); });