Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix a grid pro test case (#6665) (CP: 24.2) #6666

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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