|
1 | 1 | import { expect } from '@esm-bundle/chai'; |
2 | | -import { aTimeout, click, down, fixtureSync, isIOS } from '@vaadin/testing-helpers'; |
| 2 | +import { aTimeout, click, down, fixtureSync, isIOS, touchstart } from '@vaadin/testing-helpers'; |
| 3 | +import { sendKeys } from '@web/test-runner-commands'; |
3 | 4 | import '../src/vaadin-date-picker.js'; |
4 | 5 | import { html, PolymerElement } from '@polymer/polymer/polymer-element.js'; |
5 | 6 | import { open, outsideClick } from './common.js'; |
@@ -56,6 +57,28 @@ describe('dropdown', () => { |
56 | 57 | expect(document.activeElement).to.equal(input); |
57 | 58 | }); |
58 | 59 |
|
| 60 | + describe('virtual keyboard', () => { |
| 61 | + it('should disable virtual keyboard on close', async () => { |
| 62 | + await open(datepicker); |
| 63 | + datepicker.close(); |
| 64 | + expect(input.inputMode).to.equal('none'); |
| 65 | + }); |
| 66 | + |
| 67 | + it('should re-enable virtual keyboard on touchstart', async () => { |
| 68 | + await open(datepicker); |
| 69 | + datepicker.close(); |
| 70 | + touchstart(datepicker); |
| 71 | + expect(input.inputMode).to.equal(''); |
| 72 | + }); |
| 73 | + |
| 74 | + it('should re-enable virtual keyboard on blur', async () => { |
| 75 | + await open(datepicker); |
| 76 | + datepicker.close(); |
| 77 | + await sendKeys({ press: 'Tab' }); |
| 78 | + expect(input.inputMode).to.equal(''); |
| 79 | + }); |
| 80 | + }); |
| 81 | + |
59 | 82 | describe('sizing', () => { |
60 | 83 | beforeEach(() => { |
61 | 84 | const viewport = document.createElement('meta'); |
|
0 commit comments