fix(editor): Only show previous nodes for tools in input panel (#19335)

This commit is contained in:
Benjamin Schroth
2025-09-12 16:59:26 +02:00
committed by GitHub
parent 1a5fd5a238
commit bd8dfc074b
3 changed files with 259 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
import { test, expect } from '../../fixtures/base';
test.describe('AI-1401 AI sub-nodes show node output with no path back in input', () => {
test('should show correct root node for nested sub-nodes in input panel', async ({ n8n }) => {
await n8n.start.fromImportedWorkflow('Test_ai_1401.json');
// Execute the workflow first to generate data
await n8n.canvas.executeNode('Edit Fields');
await n8n.page.waitForTimeout(3000); // Wait for execution to complete
for (const node of ['hackernews_top', 'hackernews_sub']) {
await n8n.canvas.openNode(node);
await expect(n8n.ndv.getContainer()).toBeVisible();
await expect(n8n.ndv.inputPanel.get()).toBeVisible();
// Switch to JSON mode within the mapping view
await n8n.ndv.inputPanel.switchDisplayMode('json');
// Verify the input node dropdown shows the correct parent nodes
const inputNodeSelect = n8n.ndv.inputPanel.get().locator('[data-test-id*="input-select"]');
await expect(inputNodeSelect).toBeVisible();
await inputNodeSelect.click();
await expect(n8n.page.getByRole('option', { name: 'Edit Fields' })).toBeVisible();
await expect(n8n.page.getByRole('option', { name: 'Manual Trigger' })).toBeVisible();
await expect(n8n.page.getByRole('option', { name: 'No Operation, do nothing' })).toBeHidden();
await n8n.ndv.clickBackToCanvasButton();
}
});
});