Skip to content

Commit

Permalink
test: use sendKeys for keyboard navigation tests (#3378)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Feb 3, 2022
1 parent 9fc6298 commit 222c1f3
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 195 deletions.
4 changes: 1 addition & 3 deletions packages/date-picker/test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ export function getFocusedMonth(overlayContent) {
});
}

export function getFocusedCell(datepicker) {
const overlayContent = getOverlayContent(datepicker);

export function getFocusedCell(overlayContent) {
const months = Array.from(overlayContent.shadowRoot.querySelectorAll('vaadin-month-calendar'));

// Date that is currently focused
Expand Down
2 changes: 1 addition & 1 deletion packages/date-picker/test/keyboard-input.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe('keyboard', () => {
it('should move focus back to the input on calendar date tap', async () => {
// Move focus to the calendar
await sendKeys({ press: 'Tab' });
const cell = getFocusedCell(datepicker);
const cell = getFocusedCell(overlayContent);
const spy = sinon.spy(input, 'focus');
tap(cell);
expect(spy.calledOnce).to.be.true;
Expand Down
Loading

0 comments on commit 222c1f3

Please sign in to comment.