mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Adds a workflow progress panel component underneath the `actionbar-container`. I suggest starting a review at the extraneous changes that were needed. Including but not limited to: - `get createTime()` in queueStore - `promptIdToWorkflowId`, `initializingPromptIds`, and `nodeProgressStatesByPrompt` in executionStore - `create_time` handling in v2ToV1Adapter - `pointer-events-auto` on ComfyActionbar.vue The rest of the changes should be contained under `QueueProgressOverlay.vue`, and has less of a blast radius in case something goes wrong. --------- Co-authored-by: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Jin Yi <jin12cc@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: Johnpaul Chiwetelu <49923152+Myestery@users.noreply.github.com> Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: Comfy Org PR Bot <snomiao+comfy-pr@gmail.com> Co-authored-by: christian-byrne <72887196+christian-byrne@users.noreply.github.com>
70 lines
1.7 KiB
TypeScript
70 lines
1.7 KiB
TypeScript
import { mount } from '@vue/test-utils'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { createI18n } from 'vue-i18n'
|
|
|
|
import QueueOverlayEmpty from './QueueOverlayEmpty.vue'
|
|
import type { CompletionSummary } from '@/composables/queue/useCompletionSummary'
|
|
|
|
const i18n = createI18n({
|
|
legacy: false,
|
|
locale: 'en',
|
|
messages: {
|
|
en: {
|
|
sideToolbar: {
|
|
queueProgressOverlay: {
|
|
expandCollapsedQueue: 'Expand job queue',
|
|
noActiveJobs: 'No active jobs'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
|
|
const CompletionSummaryBannerStub = {
|
|
name: 'CompletionSummaryBanner',
|
|
props: [
|
|
'mode',
|
|
'completedCount',
|
|
'failedCount',
|
|
'thumbnailUrls',
|
|
'ariaLabel'
|
|
],
|
|
emits: ['click'],
|
|
template: '<button class="summary-banner" @click="$emit(\'click\')"></button>'
|
|
}
|
|
|
|
const mountComponent = (summary: CompletionSummary) =>
|
|
mount(QueueOverlayEmpty, {
|
|
props: { summary },
|
|
global: {
|
|
plugins: [i18n],
|
|
components: { CompletionSummaryBanner: CompletionSummaryBannerStub }
|
|
}
|
|
})
|
|
|
|
describe('QueueOverlayEmpty', () => {
|
|
it('renders completion summary banner and proxies click', async () => {
|
|
const summary: CompletionSummary = {
|
|
mode: 'mixed',
|
|
completedCount: 2,
|
|
failedCount: 1,
|
|
thumbnailUrls: ['thumb-a']
|
|
}
|
|
|
|
const wrapper = mountComponent(summary)
|
|
const summaryBanner = wrapper.findComponent(CompletionSummaryBannerStub)
|
|
|
|
expect(summaryBanner.exists()).toBe(true)
|
|
expect(summaryBanner.props()).toMatchObject({
|
|
mode: 'mixed',
|
|
completedCount: 2,
|
|
failedCount: 1,
|
|
thumbnailUrls: ['thumb-a'],
|
|
ariaLabel: 'Expand job queue'
|
|
})
|
|
|
|
await summaryBanner.trigger('click')
|
|
expect(wrapper.emitted('summaryClick')).toHaveLength(1)
|
|
})
|
|
})
|