diff --git a/src/components/dropdown/dropdown.test.ts b/src/components/dropdown/dropdown.test.ts index 1140ede3..932a000f 100644 --- a/src/components/dropdown/dropdown.test.ts +++ b/src/components/dropdown/dropdown.test.ts @@ -1,6 +1,6 @@ import '../../../dist/shoelace.js'; +import { aTimeout, expect, fixture, html, waitUntil } from '@open-wc/testing'; import { clickOnElement } from '../../internal/test.js'; -import { expect, fixture, html, waitUntil } from '@open-wc/testing'; import { sendKeys, sendMouse } from '@web/test-runner-commands'; import sinon from 'sinon'; import type SlDropdown from './dropdown.js'; @@ -354,27 +354,4 @@ describe('', () => { expect(el.open).to.be.false; }); - - it('should close and stop propagating the keydown event when Escape is pressed and the dropdown is open ', async () => { - const el = await fixture(html` - - Toggle - - Dropdown Item 1 - Dropdown Item 2 - Dropdown Item 3 - - - `); - const firstMenuItem = el.querySelector('sl-menu-item')!; - const hideHandler = sinon.spy(); - - document.body.addEventListener('keydown', hideHandler); - firstMenuItem.focus(); - await sendKeys({ press: 'Escape' }); - await el.updateComplete; - - expect(el.open).to.be.false; - expect(hideHandler).to.not.have.been.called; - }); });