mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-08 22:33:08 +00:00
test: fix failing test and add comprehensive version extraction test coverage
Address code review feedback from PR #285: 1. Fix Failing Test (CRITICAL) - Updated test from baseDescription.defaultVersion to description.defaultVersion - Added test to verify baseDescription is correctly ignored (legacy bug) 2. Add Missing Test Coverage (HIGH PRIORITY) - Test currentVersion priority over description.defaultVersion - Test currentVersion = 0 edge case (version 0 should be valid) - All 34 tests now passing 3. Enhanced Documentation - Added comprehensive JSDoc for extractVersion() explaining priority chain - Enhanced validation comments explaining why typeVersion must run before langchain skip - Clarified that parameter validation (not typeVersion) is skipped for langchain nodes Test Results: - ✅ 34/34 tests passing - ✅ Version extraction priority chain validated - ✅ Edge cases covered (version 0, missing properties) - ✅ Legacy bug prevention tested 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -445,7 +445,9 @@ export class WorkflowValidator {
|
||||
}
|
||||
|
||||
// Validate typeVersion for ALL versioned nodes (including langchain nodes)
|
||||
// This validation runs BEFORE the langchain skip to ensure typeVersion is checked
|
||||
// CRITICAL: This MUST run BEFORE the langchain skip below!
|
||||
// Otherwise, langchain nodes with invalid typeVersion (e.g., 99999) would pass validation
|
||||
// but fail at runtime in n8n. This was the bug fixed in v2.17.4.
|
||||
if (nodeInfo.isVersioned) {
|
||||
// Check if typeVersion is missing
|
||||
if (!node.typeVersion) {
|
||||
@@ -485,9 +487,9 @@ export class WorkflowValidator {
|
||||
}
|
||||
}
|
||||
|
||||
// Skip parameter validation for langchain nodes
|
||||
// They have dedicated AI-specific validators in validateAISpecificNodes()
|
||||
// This prevents parameter validation conflicts and ensures proper AI validation
|
||||
// Skip PARAMETER validation for langchain nodes (but NOT typeVersion validation above!)
|
||||
// Langchain nodes have dedicated AI-specific validators in validateAISpecificNodes()
|
||||
// which handle their unique parameter structures (AI connections, tool ports, etc.)
|
||||
if (normalizedType.startsWith('nodes-langchain.')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user