test(tuning): query the window/last-week headers as column headers — #2495
test-web / test (push) Failing after 33s

getByText(/Plays/) matched my own new caption as well as the header, since
the caption explains which columns cover the window. Query by columnheader
role instead, which is what the assertion actually means.

Also reordered the caption: prepending the clarification turned it into a
run-on that opened mid-explanation before saying what the chart was.
This commit is contained in:
2026-08-06 21:20:18 -04:00
parent a094d5f8b0
commit 96abb48086
2 changed files with 8 additions and 6 deletions
+5 -2
View File
@@ -210,8 +210,11 @@ describe('Admin tuning page', () => {
// The window/last-week distinction has to be visible in the headers, or the
// Plays total reads as the denominator of the skip rate. That misreading is
// what #2495 was filed over.
expect(screen.getByText(/Plays/)).toHaveTextContent('(window)');
expect(screen.getByText(/^Skip/)).toHaveTextContent('(last wk)');
//
// 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)');
// The knob turn is listed under the chart AND tooltipped on each
// sparkline's marker tick, hence getAllBy.
expect(