test: Route ADO-2372 expression-editor assertions through (#33132)

Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
n8n-cat-bot[bot]
2026-06-26 21:46:47 +01:00
committed by GitHub
parent e78e0312ae
commit f0164ebc5e
5 changed files with 21 additions and 33 deletions
+1
View File
@@ -33,6 +33,7 @@ CHANGELOG-*.md
!packages/frontend/@n8n/design-system/**/*.mdx
build-storybook.log
build.log
tcr-dry.log
.agent-setup/
sbom-source.cdx.json
*.junit.xml
@@ -1,7 +1,7 @@
{
"version": 1,
"generated": "2026-06-26T14:01:28.240Z",
"totalViolations": 112,
"generated": "2026-06-26T15:21:58.281Z",
"totalViolations": 108,
"violations": {
"pages/AIAssistantPage.ts": [
{
@@ -363,32 +363,6 @@
"hash": "779bc814648c"
}
],
"tests/e2e/regression/ADO-2372-prevent-clipping-params.spec.ts": [
{
"rule": "selector-purity",
"line": 69,
"message": "Chained locator call in test: editor.locator('.cm-line')",
"hash": "5a9d1d0ea7b1"
},
{
"rule": "selector-purity",
"line": 70,
"message": "Chained locator call in test: editor.locator('.cm-line')",
"hash": "5a9d1d0ea7b1"
},
{
"rule": "selector-purity",
"line": 71,
"message": "Chained locator call in test: editor.locator('.cm-line')",
"hash": "5a9d1d0ea7b1"
},
{
"rule": "selector-purity",
"line": 72,
"message": "Chained locator call in test: editor.locator('.cm-line')",
"hash": "5a9d1d0ea7b1"
}
],
"tests/e2e/workflows/editor/tags.spec.ts": [
{
"rule": "selector-purity",
@@ -456,6 +456,10 @@ export class NodeDetailsViewPage extends BasePage {
return this.inlineExpressionEditor.getContent();
}
getInlineExpressionEditorLine(index: number) {
return this.inlineExpressionEditor.getLine(index);
}
getInlineExpressionEditorOutput() {
return this.inlineExpressionEditor.getOutput();
}
@@ -43,6 +43,16 @@ export class InlineExpressionEditor {
return this.getInput().locator('.cm-content');
}
/** CodeMirror rendered lines within the in-NDV editor content. */
getLines(): Locator {
return this.getContent().locator('.cm-line');
}
/** A single rendered CodeMirror line by zero-based index. */
getLine(index: number): Locator {
return this.getLines().nth(index);
}
/** Teleported preview popover (same test id as the output). */
getPreview(): Locator {
return this.page.getByTestId('inline-expression-editor-output');
@@ -65,11 +65,10 @@ test.describe(
await expect(n8n.ndv.getInlineExpressionEditorInput().nth(0)).toBeVisible();
const editor = n8n.ndv.getInlineExpressionEditorInput().nth(0);
await expect(editor.locator('.cm-line').nth(0)).toHaveText('1 visible!');
await expect(editor.locator('.cm-line').nth(0)).toBeVisible();
await expect(editor.locator('.cm-line').nth(6)).toHaveText('7 not visible!');
await expect(editor.locator('.cm-line').nth(6)).not.toBeInViewport();
await expect(n8n.ndv.getInlineExpressionEditorLine(0)).toHaveText('1 visible!');
await expect(n8n.ndv.getInlineExpressionEditorLine(0)).toBeVisible();
await expect(n8n.ndv.getInlineExpressionEditorLine(6)).toHaveText('7 not visible!');
await expect(n8n.ndv.getInlineExpressionEditorLine(6)).not.toBeInViewport();
});
},
);