mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
test: cover queue button behavior by QPO setting
This commit is contained in:
@@ -13,6 +13,7 @@ import type {
|
|||||||
JobStatus
|
JobStatus
|
||||||
} from '@/platform/remote/comfyui/jobs/jobTypes'
|
} from '@/platform/remote/comfyui/jobs/jobTypes'
|
||||||
import { useSettingStore } from '@/platform/settings/settingStore'
|
import { useSettingStore } from '@/platform/settings/settingStore'
|
||||||
|
import { useCommandStore } from '@/stores/commandStore'
|
||||||
import { TaskItemImpl, useQueueStore } from '@/stores/queueStore'
|
import { TaskItemImpl, useQueueStore } from '@/stores/queueStore'
|
||||||
import { useSidebarTabStore } from '@/stores/workspace/sidebarTabStore'
|
import { useSidebarTabStore } from '@/stores/workspace/sidebarTabStore'
|
||||||
import { isElectron } from '@/utils/envUtil'
|
import { isElectron } from '@/utils/envUtil'
|
||||||
@@ -162,6 +163,22 @@ describe('TopMenuSection', () => {
|
|||||||
).toBe(false)
|
).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 () => {
|
it('opens the assets sidebar tab when QPO V2 is enabled', async () => {
|
||||||
const pinia = createTestingPinia({ createSpy: vi.fn, stubActions: false })
|
const pinia = createTestingPinia({ createSpy: vi.fn, stubActions: false })
|
||||||
const settingStore = useSettingStore(pinia)
|
const settingStore = useSettingStore(pinia)
|
||||||
|
|||||||
@@ -46,7 +46,11 @@
|
|||||||
type="destructive"
|
type="destructive"
|
||||||
size="md"
|
size="md"
|
||||||
:aria-pressed="
|
:aria-pressed="
|
||||||
isQueueProgressOverlayVisible ? isQueueOverlayExpanded : undefined
|
isQueuePanelV2Enabled
|
||||||
|
? activeSidebarTabId === 'assets'
|
||||||
|
: isQueueProgressOverlayVisible
|
||||||
|
? isQueueOverlayExpanded
|
||||||
|
: undefined
|
||||||
"
|
"
|
||||||
class="px-3"
|
class="px-3"
|
||||||
data-testid="queue-overlay-toggle"
|
data-testid="queue-overlay-toggle"
|
||||||
@@ -137,6 +141,7 @@ const queueUIStore = useQueueUIStore()
|
|||||||
const sidebarTabStore = useSidebarTabStore()
|
const sidebarTabStore = useSidebarTabStore()
|
||||||
const { activeJobsCount } = storeToRefs(queueStore)
|
const { activeJobsCount } = storeToRefs(queueStore)
|
||||||
const { isOverlayExpanded: isQueueOverlayExpanded } = storeToRefs(queueUIStore)
|
const { isOverlayExpanded: isQueueOverlayExpanded } = storeToRefs(queueUIStore)
|
||||||
|
const { activeSidebarTabId } = storeToRefs(sidebarTabStore)
|
||||||
const releaseStore = useReleaseStore()
|
const releaseStore = useReleaseStore()
|
||||||
const { shouldShowRedDot: showReleaseRedDot } = storeToRefs(releaseStore)
|
const { shouldShowRedDot: showReleaseRedDot } = storeToRefs(releaseStore)
|
||||||
const { shouldShowRedDot: shouldShowConflictRedDot } =
|
const { shouldShowRedDot: shouldShowConflictRedDot } =
|
||||||
|
|||||||
Reference in New Issue
Block a user