From 6bc8c93c55f9c8340f521156307a0e9ccf68ca3e Mon Sep 17 00:00:00 2001 From: Abhigyan Patwari Date: Sat, 4 Apr 2026 13:47:08 +0530 Subject: [PATCH] fix(e2e): scope node count selector to footer to avoid strict mode violation getByText(/\d+ nodes/) matched 3 elements. Scope to the footer (StatusBar) to avoid ambiguity. Co-Authored-By: Claude Opus 4.6 (1M context) --- gitnexus-web/e2e/multi-repo-scoping.spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gitnexus-web/e2e/multi-repo-scoping.spec.ts b/gitnexus-web/e2e/multi-repo-scoping.spec.ts index 600589869..67ee06b08 100644 --- a/gitnexus-web/e2e/multi-repo-scoping.spec.ts +++ b/gitnexus-web/e2e/multi-repo-scoping.spec.ts @@ -99,12 +99,13 @@ test.describe('Multi-Repo Scoping', () => { const expectedNodes = repoInfo.stats?.nodes; if (expectedNodes) { - // Status bar should show the correct node count - const nodeText = page.getByText(/\d+ nodes/); + // Status bar shows node count — use the status-ready area to avoid + // matching multiple elements (file tree, header may also show counts) + const statusBar = page.locator('footer'); + const nodeText = statusBar.getByText(/\d+ nodes/).first(); await expect(nodeText).toBeVisible({ timeout: 10_000 }); const text = await nodeText.textContent(); const displayedNodes = parseInt(text?.match(/(\d+)\s*nodes/)?.[1] ?? '0', 10); - // Allow some variance (graph may filter some nodes) expect(displayedNodes).toBeGreaterThan(0); } });