Skip to content

Commit

Permalink
refactor: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiBaicu26 committed Nov 1, 2023
1 parent b2b11d1 commit 32448d2
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions packages/overlay/test/overlay-trigger-click.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<OverlayTrigger>(html`
<overlay-trigger
placement="right-start"
@sp-opened=${() => openedSpy()}
@sp-closed=${() => closedSpy()}
>
<overlay-trigger placement="right-start">
<sp-button slot="trigger" variant="primary"></sp-button>
<sp-tooltip
slot="click-content"
Expand All @@ -198,14 +189,11 @@ describe('Overlay Trigger - Click', () => {
></sp-tooltip>
</overlay-trigger>
`);
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);
Expand Down

0 comments on commit 32448d2

Please sign in to comment.