// @vitest-environment happy-dom import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { mount } from '@vue/test-utils' import DisplayPage from '../../src/components/DisplayPage.vue' // Mock globale WebSocket per jsdom class MockWebSocket { static OPEN = 1 static CONNECTING = 0 readyState = 0 onopen = null onclose = null onmessage = null onerror = null send = vi.fn() close = vi.fn() constructor() { setTimeout(() => { this.readyState = 1 if (this.onopen) this.onopen() }, 0) } } vi.stubGlobal('WebSocket', MockWebSocket) // Mock requestFullscreen e speechSynthesis vi.stubGlobal('speechSynthesis', { speak: vi.fn(), cancel: vi.fn(), getVoices: () => [] }) // happy-dom non implementa la riproduzione media: stub di play/pause/load // così l'overlay time out può montare il