Mock out vueuse/router

This commit is contained in:
Austin Mroz
2025-12-01 16:03:07 -08:00
parent d6f823b66d
commit d842485f73
2 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import { createPinia, setActivePinia } from 'pinia'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { nextTick } from 'vue'
import { nextTick, ref } from 'vue'
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
import type { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
@@ -44,6 +44,10 @@ vi.mock('@/utils/graphTraversalUtil', () => ({
findSubgraphPathById: vi.fn()
}))
vi.mock('@vueuse/router', () => ({
useRouteHash: () => ref('')
}))
describe('useSubgraphNavigationStore', () => {
beforeEach(() => {
setActivePinia(createPinia())

View File

@@ -1,6 +1,6 @@
import { createPinia, setActivePinia } from 'pinia'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { nextTick } from 'vue'
import { nextTick, ref } from 'vue'
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
import type { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
@@ -41,6 +41,10 @@ vi.mock('@/renderer/core/canvas/canvasStore', () => ({
})
}))
vi.mock('@vueuse/router', () => ({
useRouteHash: () => ref('')
}))
// Get reference to mock canvas
const mockCanvas = app.canvas as any