Skip to content

Commit 68a699c

Browse files
satraclaude
andcommitted
fix(026): e2e uses the neuroscape result-count testid (was OHBM-only)
The density e2e timed out 240s waiting for `result-count`, which only exists on /ohbm2026/ (ResultList.svelte). NeuroScape's browse panel uses `neuroscape-result-count`, text "461,316 matches · showing first 200" — parse only the LEADING number so the "showing first N" suffix isn't concatenated. Backdrop-count (plotly .data) + drag + clear paths were fine (the run reached this helper after them). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 48733ee commit 68a699c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

site/src/tests/e2e/neuroscape_year_density.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ async function renderedBackdropCount(page: Page): Promise<number> {
4040
}
4141

4242
async function resultCount(page: Page): Promise<number> {
43-
const t = (await page.getByTestId('result-count').textContent())?.trim() ?? '0';
44-
return Number.parseInt(t.replace(/[^0-9]/g, ''), 10) || 0;
43+
// NeuroScape's count testid is `neuroscape-result-count` (the OHBM-only
44+
// `result-count` does not exist here). Text is e.g.
45+
// "461,316 matches · showing first 200" — parse only the LEADING number
46+
// so the "showing first N" suffix isn't concatenated in.
47+
const t = (await page.getByTestId('neuroscape-result-count').textContent())?.trim() ?? '';
48+
const m = t.match(/[\d,]+/);
49+
return m ? Number(m[0].replace(/,/g, '')) : 0;
4550
}
4651

4752
/** Drag a slider handle to an absolute fraction of the track width. */

0 commit comments

Comments
 (0)