mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
fix: update unit tests for border/outline unification
- Remove overlay div assertions (node-state-outline-overlay removed) - Add createSharedComposable to @vueuse/core mock - Add offsetWidth/offsetHeight to ResizeObserver test elements
This commit is contained in:
@@ -212,13 +212,8 @@ describe('LGraphNode', () => {
|
||||
|
||||
const wrapper = mountLGraphNode({ nodeData: mockNodeData })
|
||||
|
||||
// Root div should have the selection class
|
||||
// Root div should have the selection outline
|
||||
expect(wrapper.classes()).toContain('outline-node-component-outline')
|
||||
|
||||
// The layered outline overlay should be present
|
||||
const overlay = wrapper.find('[data-testid="node-state-outline-overlay"]')
|
||||
expect(overlay.exists()).toBe(true)
|
||||
expect(overlay.classes()).toContain('border-node-component-outline')
|
||||
})
|
||||
|
||||
it('should render progress indicator when executing prop is true', () => {
|
||||
@@ -226,13 +221,8 @@ describe('LGraphNode', () => {
|
||||
|
||||
const wrapper = mountLGraphNode({ nodeData: mockNodeData })
|
||||
|
||||
// Root div should have the executing class
|
||||
// Root div should have the executing outline
|
||||
expect(wrapper.classes()).toContain('outline-node-stroke-executing')
|
||||
|
||||
// The layered outline overlay should be present
|
||||
const overlay = wrapper.find('[data-testid="node-state-outline-overlay"]')
|
||||
expect(overlay.exists()).toBe(true)
|
||||
expect(overlay.classes()).toContain('border-node-stroke-executing')
|
||||
})
|
||||
|
||||
it('should initialize height CSS vars for collapsed nodes', () => {
|
||||
|
||||
@@ -47,7 +47,8 @@ const testState = vi.hoisted(() => ({
|
||||
}))
|
||||
|
||||
vi.mock('@vueuse/core', () => ({
|
||||
useDocumentVisibility: () => ref<'visible' | 'hidden'>('visible')
|
||||
useDocumentVisibility: () => ref<'visible' | 'hidden'>('visible'),
|
||||
createSharedComposable: <T>(fn: T) => fn
|
||||
}))
|
||||
|
||||
vi.mock('@/renderer/core/canvas/canvasStore', () => ({
|
||||
@@ -99,6 +100,8 @@ function createResizeEntry(options?: {
|
||||
if (collapsed) {
|
||||
element.dataset.collapsed = ''
|
||||
}
|
||||
Object.defineProperty(element, 'offsetWidth', { value: width })
|
||||
Object.defineProperty(element, 'offsetHeight', { value: height })
|
||||
const rectSpy = vi.fn(() => new DOMRect(left, top, width, height))
|
||||
element.getBoundingClientRect = rectSpy
|
||||
const boxSizes = [{ inlineSize: width, blockSize: height }]
|
||||
|
||||
Reference in New Issue
Block a user