import { mount } from '@vue/test-utils' import { createI18n } from 'vue-i18n' import { afterEach, describe, expect, it, vi } from 'vitest' import { defineComponent, nextTick } from 'vue' import JobHistorySidebarTab from './JobHistorySidebarTab.vue' const JobDetailsPopoverStub = defineComponent({ name: 'JobDetailsPopover', props: { jobId: { type: String, required: true }, workflowId: { type: String, default: undefined } }, template: '
' }) vi.mock('@/composables/queue/useJobList', async () => { const { ref } = await import('vue') const jobHistoryItem = { id: 'job-1', title: 'Job 1', meta: 'meta', state: 'completed', taskRef: { workflowId: 'workflow-1', previewOutput: { isImage: true, isVideo: false, url: '/api/view/job-1.png' } } } return { useJobList: () => ({ selectedJobTab: ref('All'), selectedWorkflowFilter: ref('all'), selectedSortMode: ref('mostRecent'), searchQuery: ref(''), hasFailedJobs: ref(false), filteredTasks: ref([]), groupedJobItems: ref([ { key: 'group-1', label: 'Group 1', items: [jobHistoryItem] } ]) }) } }) vi.mock('@/composables/queue/useJobMenu', () => ({ useJobMenu: () => ({ jobMenuEntries: [], cancelJob: vi.fn() }) })) vi.mock('@/composables/queue/useQueueClearHistoryDialog', () => ({ useQueueClearHistoryDialog: () => ({ showQueueClearHistoryDialog: vi.fn() }) })) vi.mock('@/composables/queue/useResultGallery', async () => { const { ref } = await import('vue') return { useResultGallery: () => ({ galleryActiveIndex: ref(-1), galleryItems: ref([]), onViewItem: vi.fn() }) } }) vi.mock('@/composables/useErrorHandling', () => ({ useErrorHandling: () => ({ wrapWithErrorHandlingAsync: