mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
Fix errors from rebase (removed Tag component import and duplicated imports in api.ts) (#4608)
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 70 KiB |
82
src/components/dialog/content/manager/ManagerHeader.test.ts
Normal file
82
src/components/dialog/content/manager/ManagerHeader.test.ts
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
import { mount } from '@vue/test-utils'
|
||||||
|
import { createPinia } from 'pinia'
|
||||||
|
import PrimeVue from 'primevue/config'
|
||||||
|
import Tag from 'primevue/tag'
|
||||||
|
import Tooltip from 'primevue/tooltip'
|
||||||
|
import { describe, expect, it } from 'vitest'
|
||||||
|
import { createI18n } from 'vue-i18n'
|
||||||
|
|
||||||
|
import enMessages from '@/locales/en/main.json'
|
||||||
|
|
||||||
|
import ManagerHeader from './ManagerHeader.vue'
|
||||||
|
|
||||||
|
const i18n = createI18n({
|
||||||
|
legacy: false,
|
||||||
|
locale: 'en',
|
||||||
|
messages: {
|
||||||
|
en: enMessages
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('ManagerHeader', () => {
|
||||||
|
const createWrapper = () => {
|
||||||
|
return mount(ManagerHeader, {
|
||||||
|
global: {
|
||||||
|
plugins: [createPinia(), PrimeVue, i18n],
|
||||||
|
directives: {
|
||||||
|
tooltip: Tooltip
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
Tag
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
it('renders the component title', () => {
|
||||||
|
const wrapper = createWrapper()
|
||||||
|
|
||||||
|
expect(wrapper.find('h2').text()).toBe(
|
||||||
|
enMessages.manager.discoverCommunityContent
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('displays the legacy manager UI tag', () => {
|
||||||
|
const wrapper = createWrapper()
|
||||||
|
|
||||||
|
const tag = wrapper.find('[data-pc-name="tag"]')
|
||||||
|
expect(tag.exists()).toBe(true)
|
||||||
|
expect(tag.text()).toContain(enMessages.manager.legacyManagerUI)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('applies info severity to the tag', () => {
|
||||||
|
const wrapper = createWrapper()
|
||||||
|
|
||||||
|
const tag = wrapper.find('[data-pc-name="tag"]')
|
||||||
|
expect(tag.classes()).toContain('p-tag-info')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('displays info icon in the tag', () => {
|
||||||
|
const wrapper = createWrapper()
|
||||||
|
|
||||||
|
const icon = wrapper.find('.pi-info-circle')
|
||||||
|
expect(icon.exists()).toBe(true)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('has cursor-help class on the tag', () => {
|
||||||
|
const wrapper = createWrapper()
|
||||||
|
|
||||||
|
const tag = wrapper.find('[data-pc-name="tag"]')
|
||||||
|
expect(tag.classes()).toContain('cursor-help')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('has proper structure with flex container', () => {
|
||||||
|
const wrapper = createWrapper()
|
||||||
|
|
||||||
|
const flexContainer = wrapper.find('.flex.justify-end.ml-auto.pr-4')
|
||||||
|
expect(flexContainer.exists()).toBe(true)
|
||||||
|
|
||||||
|
const tag = flexContainer.find('[data-pc-name="tag"]')
|
||||||
|
expect(tag.exists()).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -4,16 +4,22 @@
|
|||||||
<h2 class="text-lg font-normal text-left">
|
<h2 class="text-lg font-normal text-left">
|
||||||
{{ $t('manager.discoverCommunityContent') }}
|
{{ $t('manager.discoverCommunityContent') }}
|
||||||
</h2>
|
</h2>
|
||||||
<Tag
|
<div class="flex justify-end ml-auto pr-4">
|
||||||
v-tooltip.left="$t('manager.legacyManagerUIDescription')"
|
<Tag
|
||||||
severity="info"
|
v-tooltip.left="$t('manager.legacyManagerUIDescription')"
|
||||||
icon="pi pi-info-circle"
|
severity="info"
|
||||||
:value="$t('manager.legacyManagerUI')"
|
icon="pi pi-info-circle"
|
||||||
class="cursor-help"
|
:value="$t('manager.legacyManagerUI')"
|
||||||
:pt="{
|
class="cursor-help"
|
||||||
root: { class: 'text-xs' }
|
:pt="{
|
||||||
}"
|
root: { class: 'text-xs' }
|
||||||
/>
|
}"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import Tag from 'primevue/tag'
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -34,12 +34,8 @@ import type {
|
|||||||
ComfyWorkflowJSON,
|
ComfyWorkflowJSON,
|
||||||
NodeId
|
NodeId
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
} from '@/schemas/comfyWorkflowSchema'
|
||||||
import {
|
|
||||||
type ComfyNodeDef,
|
|
||||||
validateComfyNodeDef
|
|
||||||
} from '@/schemas/nodeDefSchema'
|
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
|
||||||
import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
||||||
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
import { WorkflowTemplates } from '@/types/workflowTemplateTypes'
|
import { WorkflowTemplates } from '@/types/workflowTemplateTypes'
|
||||||
|
|
||||||
interface QueuePromptRequestBody {
|
interface QueuePromptRequestBody {
|
||||||
|
|||||||
Reference in New Issue
Block a user