From 76095542f4b1a26d6466618ba0d04cc0af614943 Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Thu, 22 Jan 2026 20:13:26 -0800 Subject: [PATCH] test: cover queue button behavior by QPO setting --- src/components/TopMenuSection.test.ts | 17 +++++++++++++++++ src/components/TopMenuSection.vue | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/components/TopMenuSection.test.ts b/src/components/TopMenuSection.test.ts index 16b6430d1..8d4f3673d 100644 --- a/src/components/TopMenuSection.test.ts +++ b/src/components/TopMenuSection.test.ts @@ -13,6 +13,7 @@ import type { JobStatus } from '@/platform/remote/comfyui/jobs/jobTypes' import { useSettingStore } from '@/platform/settings/settingStore' +import { useCommandStore } from '@/stores/commandStore' import { TaskItemImpl, useQueueStore } from '@/stores/queueStore' import { useSidebarTabStore } from '@/stores/workspace/sidebarTabStore' import { isElectron } from '@/utils/envUtil' @@ -162,6 +163,22 @@ describe('TopMenuSection', () => { ).toBe(false) }) + it('toggles the queue progress overlay when QPO V2 is disabled', async () => { + const pinia = createTestingPinia({ createSpy: vi.fn, stubActions: false }) + const settingStore = useSettingStore(pinia) + vi.mocked(settingStore.get).mockImplementation((key) => + key === 'Comfy.Queue.QPOV2' ? false : undefined + ) + const wrapper = createWrapper(pinia) + const commandStore = useCommandStore(pinia) + + await wrapper.find('[data-testid="queue-overlay-toggle"]').trigger('click') + + expect(commandStore.execute).toHaveBeenCalledWith( + 'Comfy.Queue.ToggleOverlay' + ) + }) + it('opens the assets sidebar tab when QPO V2 is enabled', async () => { const pinia = createTestingPinia({ createSpy: vi.fn, stubActions: false }) const settingStore = useSettingStore(pinia) diff --git a/src/components/TopMenuSection.vue b/src/components/TopMenuSection.vue index d365d3fd8..de91e6da5 100644 --- a/src/components/TopMenuSection.vue +++ b/src/components/TopMenuSection.vue @@ -46,7 +46,11 @@ type="destructive" size="md" :aria-pressed=" - isQueueProgressOverlayVisible ? isQueueOverlayExpanded : undefined + isQueuePanelV2Enabled + ? activeSidebarTabId === 'assets' + : isQueueProgressOverlayVisible + ? isQueueOverlayExpanded + : undefined " class="px-3" data-testid="queue-overlay-toggle" @@ -137,6 +141,7 @@ const queueUIStore = useQueueUIStore() const sidebarTabStore = useSidebarTabStore() const { activeJobsCount } = storeToRefs(queueStore) const { isOverlayExpanded: isQueueOverlayExpanded } = storeToRefs(queueUIStore) +const { activeSidebarTabId } = storeToRefs(sidebarTabStore) const releaseStore = useReleaseStore() const { shouldShowRedDot: showReleaseRedDot } = storeToRefs(releaseStore) const { shouldShowRedDot: shouldShowConflictRedDot } =