From 39e13c451fa752d4e6e4e7af29977e5e66a19c8c Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:46:32 +0200 Subject: [PATCH] fix: update workflow-validator-mocks test expectations for normalized node types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/unit/services/workflow-validator-mocks.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/services/workflow-validator-mocks.test.ts b/tests/unit/services/workflow-validator-mocks.test.ts index eccb18b..c69d22a 100644 --- a/tests/unit/services/workflow-validator-mocks.test.ts +++ b/tests/unit/services/workflow-validator-mocks.test.ts @@ -645,9 +645,9 @@ describe('WorkflowValidator - Mock-based Unit Tests', () => { await validator.validateWorkflow(workflow as any); - // Should have called getNode for each node type - expect(mockGetNode).toHaveBeenCalledWith('n8n-nodes-base.httpRequest'); - expect(mockGetNode).toHaveBeenCalledWith('n8n-nodes-base.set'); + // Should have called getNode for each node type (normalized to short form) + expect(mockGetNode).toHaveBeenCalledWith('nodes-base.httpRequest'); + expect(mockGetNode).toHaveBeenCalledWith('nodes-base.set'); 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) // Note: This test documents current behavior. Could be optimized in the future. const httpRequestCalls = mockGetNode.mock.calls.filter( - call => call[0] === 'n8n-nodes-base.httpRequest' + call => call[0] === 'nodes-base.httpRequest' ); expect(httpRequestCalls.length).toBeGreaterThan(0); });