From e00886e538d444d0a4f5cfa52222e3314e73dfff Mon Sep 17 00:00:00 2001 From: Yiqun Xu <71995731+yiqun12@users.noreply.github.com> Date: Thu, 12 Jun 2025 16:50:03 -0700 Subject: [PATCH] fix: fix unit test --- src/components/templates/TemplateWorkflowCard.spec.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/templates/TemplateWorkflowCard.spec.ts b/src/components/templates/TemplateWorkflowCard.spec.ts index dc3266db8..605a4d501 100644 --- a/src/components/templates/TemplateWorkflowCard.spec.ts +++ b/src/components/templates/TemplateWorkflowCard.spec.ts @@ -1,5 +1,6 @@ import { mount } from '@vue/test-utils' -import { describe, expect, it, vi } from 'vitest' +import { createPinia, setActivePinia } from 'pinia' +import { beforeEach, describe, expect, it, vi } from 'vitest' import { ref } from 'vue' import TemplateWorkflowCard from '@/components/templates/TemplateWorkflowCard.vue' @@ -109,6 +110,10 @@ vi.mock('@/composables/useTemplateWorkflows', () => ({ })) describe('TemplateWorkflowCard', () => { + beforeEach(() => { + setActivePinia(createPinia()) + }) + const createTemplate = (overrides = {}): TemplateInfo => ({ name: 'test-template', mediaType: 'image',