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:
jaeone94
2026-03-30 16:26:25 +09:00
parent 5b8d21bfa1
commit d74cfe165c
2 changed files with 6 additions and 13 deletions

View File

@@ -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', () => {

View File

@@ -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 }]