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) <noreply@anthropic.com>
This commit is contained in:
Abhigyan Patwari 2026-04-04 13:47:08 +05:30
parent 641615dae4
commit 6bc8c93c55

View file

@ -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);
}
});