mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-30 06:22:04 +00:00
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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user