Skip to content

Derive stats tab section titles from the component - #834

Merged
ajslater merged 1 commit into
developfrom
claude/fix-stats-tab-section-titles
Sep 2, 2026
Merged

Derive stats tab section titles from the component#834
ajslater merged 1 commit into
developfrom
claude/fix-stats-tab-section-titles

Conversation

@ajslater

@ajslater ajslater commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Problem

frontend/tests/unit/stats-tab.test.js failed. Its SECTION_TITLES list still named a User Settings section that no longer exists. Commit d88f4f1 split that table into Settings by Session and Settings by User, and the spec's private copy of the titles went stale.

Fix

The tab now declares its tables once, as a SECTIONS list of caption and computed-name pairs that the template loops over, and exports the titles. The spec imports that export instead of restating the names, so renaming a section can no longer strand a copy in the test.

The template comments about the API key and the two settings denominators moved onto their entries in the list.

Assertion strength

With the titles derived, a toContain loop would pass vacuously, so the test now compares the full ordered list of rendered captions against the export. Blanking one section's title makes it fail, which I verified before restoring the file.

Verification

  • vitest run tests/unit/stats-tab.test.js: 7 passed
  • vitest run: 46 files, 447 tests passed
  • make fix then bun run lint: clean, no unrelated files touched

🤖 Generated with Claude Code

d88f4f1 split the "User Settings" table into "Settings by Session" and
"Settings by User", but the spec kept its own copy of the section titles and
still asserted the old name, so it failed.

Rather than retype the new names into the test, the tab now declares its
tables once as a SECTIONS list the template loops over, and exports the
titles. The spec compares the rendered captions to that export, so a rename
cannot leave a stale copy behind again.

The assertion is the whole ordered caption list rather than a containment
check per title. With the titles derived, containment would pass vacuously;
comparing the list still catches a section that stops rendering, one rendered
twice, or an empty title.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ajslater
ajslater merged commit 2545900 into develop Sep 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant