From 0818b4d56cb980e8e8989d34333a5998003bc997 Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Tue, 7 Oct 2025 09:30:49 +0200 Subject: [PATCH] fix: update unit tests for Calculator and Think tool validators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calculator and Think tools have built-in descriptions in n8n, so toolDescription parameter is optional. Updated unit tests to match actual n8n behavior and integration test expectations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../unit/services/ai-tool-validators.test.ts | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/unit/services/ai-tool-validators.test.ts b/tests/unit/services/ai-tool-validators.test.ts index ff6556c..deaadb3 100644 --- a/tests/unit/services/ai-tool-validators.test.ts +++ b/tests/unit/services/ai-tool-validators.test.ts @@ -554,7 +554,7 @@ return { cost: cost.toFixed(2) };`, }); describe('validateCalculatorTool', () => { - it('should error on missing toolDescription', () => { + it('should not require toolDescription (has built-in description)', () => { const node: WorkflowNode = { id: 'calc1', name: 'Math Operations', @@ -565,12 +565,8 @@ return { cost: cost.toFixed(2) };`, const issues = validateCalculatorTool(node); - expect(issues).toContainEqual( - expect.objectContaining({ - severity: 'error', - code: 'MISSING_TOOL_DESCRIPTION' - }) - ); + // Calculator Tool has built-in description, no validation needed + expect(issues).toHaveLength(0); }); it('should pass valid Calculator Tool configuration', () => { @@ -592,7 +588,7 @@ return { cost: cost.toFixed(2) };`, }); describe('validateThinkTool', () => { - it('should error on missing toolDescription', () => { + it('should not require toolDescription (has built-in description)', () => { const node: WorkflowNode = { id: 'think1', name: 'Think', @@ -603,12 +599,8 @@ return { cost: cost.toFixed(2) };`, const issues = validateThinkTool(node); - expect(issues).toContainEqual( - expect.objectContaining({ - severity: 'error', - code: 'MISSING_TOOL_DESCRIPTION' - }) - ); + // Think Tool has built-in description, no validation needed + expect(issues).toHaveLength(0); }); it('should pass valid Think Tool configuration', () => {