mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 05:23:08 +00:00
fix: update workflow-validator-mocks test expectations for normalized node types
Fixed 2 failing tests in workflow-validator-mocks.test.ts: - "should call repository getNode with correct parameters": Updated to expect short-form node types - "should optimize repository calls for duplicate node types": Updated filter to use short-form After P0-R1, node types are normalized to short form before calling repository.getNode(), so test assertions must expect short-form types (nodes-base.X) instead of full-form (n8n-nodes-base.X). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -645,9 +645,9 @@ describe('WorkflowValidator - Mock-based Unit Tests', () => {
|
|||||||
|
|
||||||
await validator.validateWorkflow(workflow as any);
|
await validator.validateWorkflow(workflow as any);
|
||||||
|
|
||||||
// Should have called getNode for each node type
|
// Should have called getNode for each node type (normalized to short form)
|
||||||
expect(mockGetNode).toHaveBeenCalledWith('n8n-nodes-base.httpRequest');
|
expect(mockGetNode).toHaveBeenCalledWith('nodes-base.httpRequest');
|
||||||
expect(mockGetNode).toHaveBeenCalledWith('n8n-nodes-base.set');
|
expect(mockGetNode).toHaveBeenCalledWith('nodes-base.set');
|
||||||
expect(mockGetNode).toHaveBeenCalledTimes(2);
|
expect(mockGetNode).toHaveBeenCalledTimes(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -712,7 +712,7 @@ describe('WorkflowValidator - Mock-based Unit Tests', () => {
|
|||||||
// Should call getNode for the same type multiple times (current implementation)
|
// Should call getNode for the same type multiple times (current implementation)
|
||||||
// Note: This test documents current behavior. Could be optimized in the future.
|
// Note: This test documents current behavior. Could be optimized in the future.
|
||||||
const httpRequestCalls = mockGetNode.mock.calls.filter(
|
const httpRequestCalls = mockGetNode.mock.calls.filter(
|
||||||
call => call[0] === 'n8n-nodes-base.httpRequest'
|
call => call[0] === 'nodes-base.httpRequest'
|
||||||
);
|
);
|
||||||
expect(httpRequestCalls.length).toBeGreaterThan(0);
|
expect(httpRequestCalls.length).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user