import { config } from '@vue/test-utils' import { vi } from 'vitest' import * as Vue from 'vue' // Mock localStorage const localStorageMock = { getItem: vi.fn(), setItem: vi.fn(), removeItem: vi.fn(), clear: vi.fn(), key: vi.fn(), length: 0, } global.localStorage = localStorageMock as unknown as Storage // Make Vue composables globally available global.ref = Vue.ref global.computed = Vue.computed global.reactive = Vue.reactive global.watch = Vue.watch global.watchEffect = Vue.watchEffect global.defineModel = Vue.defineModel global.onMounted = Vue.onMounted global.onUnmounted = Vue.onUnmounted global.nextTick = Vue.nextTick // Mock Nuxt composables global.useRuntimeConfig = vi.fn(() => ({ public: {}, })) global.useNuxtApp = vi.fn(() => ({ $apollo: {}, })) global.navigateTo = vi.fn() global.definePageMeta = vi.fn() // Mock Vuetify components globally for tests config.global.stubs = { VAlert: { name: 'v-alert', template: '
', props: ['color', 'type', 'variant'], }, VTextField: { template: '
', props: ['modelValue', 'readonly', 'disabled', 'active', 'focused', 'variant', 'error', 'errorMessages', 'label'], emits: ['update:model-value', 'blur'], }, VBtn: { name: 'v-btn', template: '', props: ['disabled', 'variant', 'icon', 'color', 'flat', 'depressed', 'xLarge'], emits: ['click'], }, VDialog: { name: 'v-dialog', template: '
', props: ['modelValue', 'width', 'maxWidth', 'persistent'], }, VForm: { name: 'v-form', template: '
', emits: ['submit'], }, VCard: { name: 'v-card', template: '
{{ title }}
', props: ['variant', 'rounded', 'loading', 'title'], }, VCardTitle: { template: '
', }, VCardText: { name: 'v-card-text', template: '
', }, VCardActions: { name: 'v-card-actions', template: '
', }, VSpacer: { name: 'v-spacer', template: '
', }, VIcon: { name: 'v-icon', template: '', props: ['icon', 'large'], emits: ['click'], }, }