Skip to content

Commit

Permalink
test: fix a grid pro test case (#6665) (#6666)
Browse files Browse the repository at this point in the history
Co-authored-by: Tomi Virkki <tomivirkki@users.noreply.github.com>
  • Loading branch information
vaadin-bot and tomivirkki authored Oct 18, 2023
1 parent 083a653 commit 83aef9a
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions packages/grid-pro/test/edit-column.test.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;
});
});
Expand Down

0 comments on commit 83aef9a

Please sign in to comment.