From 304de88c50c81119e9f2f8b2e7b85c6b8dd7ed05 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 6 Aug 2026 21:27:22 -0400 Subject: [PATCH] =?UTF-8?q?test(tuning):=20assert=20headers=20by=20exact?= =?UTF-8?q?=20accessible=20name=20=E2=80=94=20#2495?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Third attempt at the same assertion, so I stopped guessing and got vitest running locally instead: the web lane uses the same ci-go image, so `docker run ... -w /src/web ci-go:1.26 npx vitest run` works and turns a 5-minute CI round trip into 7 seconds. /^Skip/ matched the "Skip rate by week" sparkline column as well as "Skip (last wk)", just as /Plays/ had matched the caption. Exact names say what the assertion means and cannot drift onto a neighbour. Verified locally before pushing: svelte-check 0 errors, 110 files / 786 tests pass. --- web/src/routes/admin/tuning/tuning.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/routes/admin/tuning/tuning.test.ts b/web/src/routes/admin/tuning/tuning.test.ts index 00abfa72..85283657 100644 --- a/web/src/routes/admin/tuning/tuning.test.ts +++ b/web/src/routes/admin/tuning/tuning.test.ts @@ -213,8 +213,11 @@ describe('Admin tuning page', () => { // // Queried as column headers rather than by text: the caption below also // mentions "Plays", and matching on the word finds the prose too. - expect(screen.getByRole('columnheader', { name: /Plays/ })).toHaveTextContent('(window)'); - expect(screen.getByRole('columnheader', { name: /^Skip/ })).toHaveTextContent('(last wk)'); + // Exact accessible names: /^Skip/ also matches the "Skip rate by week" + // sparkline column, and /Plays/ matched the caption prose before that. + expect(screen.getByRole('columnheader', { name: 'Plays (window)' })).toBeInTheDocument(); + expect(screen.getByRole('columnheader', { name: 'Skip (last wk)' })).toBeInTheDocument(); + expect(screen.getByRole('columnheader', { name: 'Completion (last wk)' })).toBeInTheDocument(); // The knob turn is listed under the chart AND tooltipped on each // sparkline's marker tick, hence getAllBy. expect(