Skip to content

test(Tooltip, Popover): timer specs check the directive's own show and hide timers - #326

Merged
xidedix merged 1 commit into
v5.7from
test/own-timer-specs
Oct 22, 2026
Merged

xidedix merged 1 commit into
v5.7from
test/own-timer-specs

Conversation

@xidedix

@xidedix xidedix commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

vi.getTimerCount() counted every pending fake timer, not only the directive's; one extra timer created during the test failed the show-timer spec on CI (source not measured).

Show: tooltip/popover element keeps d-none after destroy. Hide: destroy clears the 300 ms hide timer the directive scheduled. Dropping either clearTimeout in destroyTooltipElement fails its spec, also with a hide callback that tolerates a missing tooltipRef.

afterEach restores spies before real timers: in the other order the setTimeout spy put the faked function back after the clock was uninstalled, and toaster specs later in the same worker timed out.

…d hide timers

`vi.getTimerCount()` counted every pending fake timer, not only the directive's; one extra timer created during the test failed the show-timer spec on CI (its source was not measured).

Show: the tooltip or popover element keeps `d-none` after destroy. Hide: destroy clears the 300 ms hide timer the directive scheduled. Dropping either `clearTimeout` in `destroyTooltipElement` fails its spec, also with a hide callback that tolerates a missing `tooltipRef`. `afterEach` restores spies before real timers, so a spy on a faked `setTimeout` is not put back after the clock is gone.
@xidedix
xidedix merged commit 22128d6 into v5.7 Oct 22, 2026
9 checks passed
@xidedix
xidedix deleted the test/own-timer-specs branch October 22, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant