Skip to content

Commit

Permalink
chore: update test to avoid race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
DRiFTy17 committed Feb 28, 2024
1 parent aaf7d63 commit cd6198e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/popover/popover.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,18 +706,20 @@ describe('Popover', () => {
expect(harness.isOpen).to.be.false;

await harness.hoverTrigger();
await timer(harness.popoverElement.hoverDelay);
await timer(harness.popoverElement.hoverDelay + 100);

expect(harness.isOpen).to.be.true;
});

it('should set the default hoverDelay value if NaN', async () => {
const harness = await createFixture({ triggerType: 'hover', hoverDelay: 'Testing' as any });

expect(harness.popoverElement.hoverDelay).to.equal(0);
});

it('should set the default hoverDelay value if the hoverDelay < 0', async () => {
const harness = await createFixture({ triggerType: 'hover', hoverDelay: -400 });

expect(harness.popoverElement.hoverDelay).to.equal(0);
});

Expand Down

0 comments on commit cd6198e

Please sign in to comment.