Skip to content

Commit bea137c

Browse files
authored
test: update confirm-dialog Esc tests to use sendKeys (#9796)
1 parent 8ff92f5 commit bea137c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/confirm-dialog/test/confirm-dialog.test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { expect } from '@vaadin/chai-plugins';
2-
import { aTimeout, esc, fixtureSync, listenOnce, nextFrame, nextRender, oneEvent } from '@vaadin/testing-helpers';
2+
import { sendKeys } from '@vaadin/test-runner-commands';
3+
import { aTimeout, fixtureSync, listenOnce, nextFrame, nextRender, oneEvent } from '@vaadin/testing-helpers';
34
import sinon from 'sinon';
45
import './not-animated-styles.js';
56
import '../src/vaadin-confirm-dialog.js';
@@ -512,16 +513,16 @@ describe('vaadin-confirm-dialog', () => {
512513
confirm.addEventListener('cancel', spy);
513514
});
514515

515-
it('should close but not cancel dialog by default', () => {
516-
esc(document.body);
516+
it('should close but not cancel dialog by default', async () => {
517+
await sendKeys({ press: 'Escape' });
517518
expect(spy.called).to.be.true;
518519
expect(confirm.opened).to.be.false;
519520
});
520521

521522
it('should not close and not cancel dialog with no-close-on-esc', async () => {
522523
confirm.noCloseOnEsc = true;
523524
await nextFrame();
524-
esc(document.body);
525+
await sendKeys({ press: 'Escape' });
525526
expect(spy.called).to.be.false;
526527
expect(confirm.opened).to.be.true;
527528
});

0 commit comments

Comments
 (0)