diff --git a/src/components/graph/selectionToolbox/BypassButton.test.ts b/src/components/graph/selectionToolbox/BypassButton.test.ts index 393e3fe55..a6fa3ff94 100644 --- a/src/components/graph/selectionToolbox/BypassButton.test.ts +++ b/src/components/graph/selectionToolbox/BypassButton.test.ts @@ -85,11 +85,10 @@ describe('BypassButton', () => { }) it('should show bypassed styling when node is bypassed', async () => { - const bypassedNode: Partial = { - ...getMockLGraphNode(), + const bypassedNode = Object.assign(getMockLGraphNode(), { mode: LGraphEventMode.BYPASS - } - canvasStore.selectedItems = [bypassedNode as LGraphNode] + }) + canvasStore.selectedItems = [bypassedNode] vi.spyOn(commandStore, 'execute').mockResolvedValue() const wrapper = mountComponent() diff --git a/src/composables/graph/useGraphHierarchy.test.ts b/src/composables/graph/useGraphHierarchy.test.ts index 6212cdbd6..c7b5a8f81 100644 --- a/src/composables/graph/useGraphHierarchy.test.ts +++ b/src/composables/graph/useGraphHierarchy.test.ts @@ -14,11 +14,13 @@ import { useGraphHierarchy } from './useGraphHierarchy' vi.mock('@/renderer/core/canvas/canvasStore') function createMockNode(overrides: Partial = {}): LGraphNode { - return { - ...createMockLGraphNode(), - boundingRect: new Rectangle(100, 100, 50, 50), - ...overrides - } as LGraphNode + return Object.assign( + createMockLGraphNode(), + { + boundingRect: new Rectangle(100, 100, 50, 50) + }, + overrides + ) } function createMockGroup(overrides: Partial = {}): LGraphGroup { diff --git a/src/utils/__tests__/litegraphTestUtils.ts b/src/utils/__tests__/litegraphTestUtils.ts index f73d0d91d..e43aa5930 100644 --- a/src/utils/__tests__/litegraphTestUtils.ts +++ b/src/utils/__tests__/litegraphTestUtils.ts @@ -191,13 +191,15 @@ export function createMockLGraphNodeWithArrayBoundingRect( * Creates a mock FileList from an array of files */ export function createMockFileList(files: File[]): FileList { - const fileList = { - ...files, - length: files.length, - item: (index: number) => files[index] ?? null, - [Symbol.iterator]: function* () { - yield* files - } - } + const fileList = Object.assign( + { + length: files.length, + item: (index: number) => files[index] ?? null, + [Symbol.iterator]: function* () { + yield* files + } + }, + files + ) return fileList as FileList }