From 688ccb5aa9681035490a15251678588d5d06dfc9 Mon Sep 17 00:00:00 2001 From: CodingOnStar Date: Tue, 24 Mar 2026 20:16:09 +0800 Subject: [PATCH] fix(tests): update variable reference picker tests with type assertions - Added type assertions for iteration and loop nodes in the variable reference picker helper tests to ensure type safety and correctness. - Improved code clarity by explicitly defining node types, enhancing maintainability of the test suite. --- .../variable/__tests__/var-reference-picker.helpers.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/nodes/_base/components/variable/__tests__/var-reference-picker.helpers.spec.ts b/web/app/components/workflow/nodes/_base/components/variable/__tests__/var-reference-picker.helpers.spec.ts index aaa9afa1b5..2e8ff0bcdd 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/__tests__/var-reference-picker.helpers.spec.ts +++ b/web/app/components/workflow/nodes/_base/components/variable/__tests__/var-reference-picker.helpers.spec.ts @@ -1,5 +1,5 @@ import type { CredentialFormSchema } from '@/app/components/header/account-setting/model-provider-page/declarations' -import type { ValueSelector } from '@/app/components/workflow/types' +import type { CommonNodeType, Node, ValueSelector } from '@/app/components/workflow/types' import { FormTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations' import { createLoopNode, createNode, createStartNode } from '@/app/components/workflow/__tests__/fixtures' import { BlockEnum, VarType } from '@/app/components/workflow/types' @@ -35,8 +35,8 @@ describe('var-reference-picker.helpers', () => { it('should resolve output variable nodes for normal, system, iteration, and loop variables', () => { const startNode = createStartNode({ id: 'start-1', data: { title: 'Start Node' } }) const normalNode = createNode({ id: 'node-a', data: { type: BlockEnum.Code, title: 'Answer Node' } }) - const iterationNode = createNode({ id: 'iter-parent', data: { type: BlockEnum.Iteration, title: 'Iteration Parent' } }) - const loopNode = createLoopNode({ id: 'loop-parent', data: { title: 'Loop Parent' } }) + const iterationNode = createNode({ id: 'iter-parent', data: { type: BlockEnum.Iteration, title: 'Iteration Parent' } }) as Node + const loopNode = createLoopNode({ id: 'loop-parent', data: { title: 'Loop Parent' } }) as Node expect(getOutputVarNode({ availableNodes: [normalNode],