// Dexie needs a real IndexedDB implementation; happy-dom does not ship one. import 'fake-indexeddb/auto' import { afterEach, vi } from 'vitest' import { config } from '@vue/test-utils' import { Notify, Quasar } from 'quasar' // Components read `$q` and use Quasar components in their templates. This // mirrors what the Quasar boot does in the app, limited to what tests need. config.global.plugins.unshift([Quasar, { plugins: { Notify } }]) // Stores read `navigator.onLine` at module load. if (typeof navigator !== 'undefined' && navigator.onLine === undefined) { Object.defineProperty(navigator, 'onLine', { value: true, configurable: true }) } // The timeline observes its own size; happy-dom has no ResizeObserver. if (typeof globalThis.ResizeObserver === 'undefined') { globalThis.ResizeObserver = class { observe() {} unobserve() {} disconnect() {} } } afterEach(() => { vi.useRealTimers() localStorage.clear() })