updated test
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
import { ref } from 'vue'
|
||||||
import { createVuetify } from 'vuetify'
|
import { createVuetify } from 'vuetify'
|
||||||
import { flushPromises } from '@vue/test-utils'
|
import { flushPromises } from '@vue/test-utils'
|
||||||
import * as components from 'vuetify/components'
|
import * as components from 'vuetify/components'
|
||||||
@@ -36,6 +37,11 @@ vi.stubGlobal('$fetch', mockFetch)
|
|||||||
const mockNavigate = vi.fn()
|
const mockNavigate = vi.fn()
|
||||||
vi.stubGlobal('navigateTo', mockNavigate)
|
vi.stubGlobal('navigateTo', mockNavigate)
|
||||||
|
|
||||||
|
vi.stubGlobal('useState', (key, init) => {
|
||||||
|
const state = ref(init ? init() : null)
|
||||||
|
return state
|
||||||
|
})
|
||||||
|
|
||||||
describe('GalleryPage.vue', () => {
|
describe('GalleryPage.vue', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.clearAllMocks()
|
vi.clearAllMocks()
|
||||||
|
|||||||
Reference in New Issue
Block a user