fix: update unit tests for Calculator and Think tool validators

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 <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-10-07 09:30:49 +02:00
parent 5e2a6bdb9c
commit 0818b4d56c

View File

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