fix(core): stub pointer:fine in tooltip touch suppression tests (#998)

This commit is contained in:
rahim
2026-03-17 23:22:32 -07:00
committed by GitHub
parent 324ea2fd3b
commit fc62ea1c0a
@@ -107,10 +107,10 @@ describe('createTooltip', () => {
describe('touch pointer suppression', () => {
beforeEach(() => {
vi.useFakeTimers();
// jsdom lacks matchMedia — stub so popover's canHover() returns true,
// allowing us to test that the tooltip layer blocks touch independently.
// jsdom lacks matchMedia — stub so popover's canHover() and canOpenOnFocus()
// return true, allowing us to test that the tooltip layer blocks touch independently.
vi.stubGlobal('matchMedia', (query: string) => ({
matches: query === '(hover: hover)',
matches: query === '(hover: hover)' || query === '(pointer: fine)',
media: query,
addEventListener: vi.fn(),
removeEventListener: vi.fn(),