diff --git a/packages/overlay/test/overlay-trigger-click.test.ts b/packages/overlay/test/overlay-trigger-click.test.ts index cc73e735ee..664e720d49 100644 --- a/packages/overlay/test/overlay-trigger-click.test.ts +++ b/packages/overlay/test/overlay-trigger-click.test.ts @@ -179,17 +179,8 @@ describe('Overlay Trigger - Click', () => { }); it('opens with a delay on click', async () => { - const openedSpy = spy(); - const closedSpy = spy(); - - const start = performance.now(); - const el = await fixture(html` - openedSpy()} - @sp-closed=${() => closedSpy()} - > + { > `); + const start = performance.now(); + const opened = oneEvent(el, 'sp-opened'); - await elementUpdated(el); el.setAttribute('open', 'click'); - await waitUntil( - () => openedSpy.calledOnce, - 'hover content projected to overlay', - { timeout: 8000 } - ); + await opened; const end = performance.now(); expect(end - start).to.be.greaterThan(1000);