mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-30 06:22:04 +00:00
Added 4 critical integration tests to prevent regression of the production-breaking array index corruption bug in multi-output nodes. Tests verify against real n8n API: 1. IF Node - Empty array preservation when removing connections - Removes true branch connection - Verifies empty array at index 0 - Verifies false branch stays at index 1 (not shifted) 2. Switch Node - Remove first case (MOST CRITICAL) - Tests exact bug scenario that was production-breaking - Removes case 0 - Verifies cases 1, 2, 3 stay at original indices 3. Switch Node - Sequential operations - Complex scenario: rewire, add, remove in sequence - Verifies indices maintained throughout operations - Tests empty arrays preserved at intermediate positions 4. Filter Node - Rewiring connections - Tests kept/discarded outputs (2-output node) - Rewires one output - Verifies other output unchanged All tests validate actual workflow structure from n8n API to ensure our fix (only remove trailing empty arrays) works correctly. Coverage: - Total: 174 tests (158 unit + 16 integration) - All tests passing ✅ - Integration tests provide regression protection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>