mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
fix: unit test modified
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
|
import { computed } from 'vue'
|
||||||
import { describe, expect, it, vi } from 'vitest'
|
import { describe, expect, it, vi } from 'vitest'
|
||||||
import { createI18n } from 'vue-i18n'
|
import { createI18n } from 'vue-i18n'
|
||||||
|
|
||||||
@@ -6,6 +7,18 @@ import ActiveJobCard from './ActiveMediaAssetCard.vue'
|
|||||||
|
|
||||||
import type { JobListItem } from '@/composables/queue/useJobList'
|
import type { JobListItem } from '@/composables/queue/useJobList'
|
||||||
|
|
||||||
|
vi.mock('@/composables/queue/useJobActions', () => ({
|
||||||
|
useJobActions: () => ({
|
||||||
|
cancelAction: {
|
||||||
|
icon: 'icon-[lucide--x]',
|
||||||
|
label: 'Cancel',
|
||||||
|
variant: 'destructive'
|
||||||
|
},
|
||||||
|
canCancelJob: computed(() => false),
|
||||||
|
runCancelJob: vi.fn()
|
||||||
|
})
|
||||||
|
}))
|
||||||
|
|
||||||
vi.mock('@/composables/useProgressBarBackground', () => ({
|
vi.mock('@/composables/useProgressBarBackground', () => ({
|
||||||
useProgressBarBackground: () => ({
|
useProgressBarBackground: () => ({
|
||||||
progressBarPrimaryClass: 'bg-blue-500',
|
progressBarPrimaryClass: 'bg-blue-500',
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ function createMockAsset(overrides: Partial<AssetItem> = {}): AssetItem {
|
|||||||
|
|
||||||
describe('useMediaAssetActions', () => {
|
describe('useMediaAssetActions', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
vi.resetModules()
|
||||||
setActivePinia(createPinia())
|
setActivePinia(createPinia())
|
||||||
vi.clearAllMocks()
|
vi.clearAllMocks()
|
||||||
capturedFilenames.values = []
|
capturedFilenames.values = []
|
||||||
|
|||||||
Reference in New Issue
Block a user