mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 02:32:18 +00:00
Merge branch 'main' into image-output-backwards-compat
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { createTestingPinia } from '@pinia/testing'
|
||||
import type { VueWrapper } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { nextTick } from 'vue'
|
||||
@@ -57,6 +58,7 @@ describe('ImagePreview', () => {
|
||||
'/api/view?filename=test2.png&type=output'
|
||||
]
|
||||
}
|
||||
const wrapperRegistry = new Set<VueWrapper>()
|
||||
|
||||
beforeEach(() => {
|
||||
delete mockNode.imgs
|
||||
@@ -64,7 +66,7 @@ describe('ImagePreview', () => {
|
||||
})
|
||||
|
||||
const mountImagePreview = (props = {}) => {
|
||||
return mount(ImagePreview, {
|
||||
const wrapper = mount(ImagePreview, {
|
||||
props: { ...defaultProps, ...props },
|
||||
global: {
|
||||
plugins: [
|
||||
@@ -82,8 +84,17 @@ describe('ImagePreview', () => {
|
||||
}
|
||||
}
|
||||
})
|
||||
wrapperRegistry.add(wrapper)
|
||||
return wrapper
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
wrapperRegistry.forEach((wrapper) => {
|
||||
wrapper.unmount()
|
||||
})
|
||||
wrapperRegistry.clear()
|
||||
})
|
||||
|
||||
it('renders image preview when imageUrls provided', () => {
|
||||
const wrapper = mountImagePreview()
|
||||
|
||||
|
||||
@@ -199,6 +199,6 @@ describe('LGraphNode', () => {
|
||||
|
||||
const wrapper = mountLGraphNode({ nodeData: mockNodeData })
|
||||
|
||||
expect(wrapper.classes()).toContain('border-node-stroke-executing')
|
||||
expect(wrapper.classes()).toContain('outline-node-stroke-executing')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user