Skip to content

Use TEST_LOCALES in the tests that rebuilt it by hand - #1118

Merged
richshaw merged 1 commit into
mainfrom
claude/issue-1083-test-locales
Nov 26, 2026
Merged

richshaw merged 1 commit into
mainfrom
claude/issue-1083-test-locales

Conversation

@richshaw

Copy link
Copy Markdown
Owner

Fixes #1083.

Session: https://claude.ai/code/session_016YZ9SSuGiGw15v9XVfXQeL

The problem

TEST_LOCALES (src/i18n/testing/locales.ts) defines a test language: every catalog language but English. But 57 places in 55 test files rebuilt that list themselves as CATALOG_LOCALES.filter((locale) => locale !== 'en'), as a local OTHER_LANGUAGES / OTHER_LOCALES constant or inline in it.each / describe.each. If the definition changed, those copies wouldn't follow it.

The fix

  • Every copy now imports TEST_LOCALES. That covers the 28 OTHER_LANGUAGES constants, the 6 OTHER_LOCALES constants, the 21 inline filters and the two e2e specs (organizer-language.spec.ts, organizer-language-story.spec.ts).
  • The one-line doc comment above each deleted constant went too, since it only restated the definition. CATALOG_LOCALES came out of the imports in files that no longer use it.
  • The two hits that aren't copies are left alone, as the issue asks: the language-pair builder in SignupHeader.test.tsx and UNSHIPPED_LOCALES in tests/e2e/helpers/unshipped-locales.ts.
  • The change was made with a script and then run through Prettier and ESLint. It changes tests only, and no runtime code.

Tests

  • grep -rnE "CATALOG_LOCALES\.filter" src tests now finds only the definition and the two non-copies.
  • I ran vitest list on the 53 touched unit and DB test files, before and after the change. Both runs list the same 877 tests with identical names.
  • Passed: pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test (3882 passed, 1 expected fail).
  • pnpm test:db passed against local Postgres: 901 tests in the first run. The query-budget file needed the NEXT_PUBLIC_* env from run-opensignup, and passed once that was set.
  • The two e2e specs are covered by the typecheck and lint. I didn't run them, because only their list of languages changed.

Generated by Claude Code

55 test files built "every catalog language but English" themselves, as
CATALOG_LOCALES.filter((locale) => locale !== 'en'), in a local
OTHER_LANGUAGES or OTHER_LOCALES constant or inline in it.each and
describe.each. They now import TEST_LOCALES from src/i18n/testing/locales,
the list CLAUDE.md and docs/translating.md name, so a change to what counts
as a test language reaches every test. Test-only: the same tests run, under
the same names.

Fixes #1083.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SSuGiGw15v9XVfXQeL
@richshaw richshaw added pipeline:tophat pipeline:working A session is working on it right now and removed pipeline:working A session is working on it right now labels Nov 26, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Tophat: passed

What changes for people: Nothing. This PR changes tests only, so there was nothing to click through in the app.

Check Result What I saw
No runtime code changed ✅ All 55 changed files are unit, DB or e2e tests. The shared "runtime changed" check counts 0 hunks against main.
Same tests before and after ✅ vitest list on the 47 touched unit test files lists 877 tests on base and on head, and the sorted lists are identical.
The touched unit tests pass ✅ 47 files, 877 passed on head. pnpm typecheck and pnpm lint are clean.
Copies gone ✅ grep CATALOG_LOCALES.filter now finds only the TEST_LOCALES definition, the pair builder in SignupHeader.test.tsx and UNSHIPPED_LOCALES, which the issue says to leave.

Not checked: I didn't re-run the 6 DB test files or the two e2e specs here. CI ran e2e green on this SHA, and the PR reports a pnpm test:db pass.

Ran 6cac438 against 3ace3e5 locally, no app needed, no data. https://claude.ai/code/session_016YZ9ST5DVxZNyWwie56jbd


Generated by Claude Code

@richshaw richshaw left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: passed (round 1)

Every hand-written CATALOG_LOCALES.filter(… !== 'en') now imports TEST_LOCALES, across 53 unit and DB test files and the two e2e specs. The grep finds only the definition and the two non-copies the issue says to keep. Every "Done when" item holds: vitest list on the 47 touched unit files gives the same 877 names on base and head, and they pass. It changes tests only.

Blocking (0)
Optional (1): six tests rebuild OTHER_LOCALE by hand the same way (CATALOG_LOCALES.find(l => l !== 'en') ?? 'en'). That's outside #1083's scope, so it's filed as #1119.
Earlier threads: none
Checks: CI is green on 6cac438 (lint-type-test, e2e, CodeQL). The tophat passed on this SHA, with 0 runtime hunks. Locally, typecheck and lint pass and so do the touched unit tests.

https://claude.ai/code/session_016YZ9ST5DVxZNyWwie56jbd


Generated by Claude Code

@richshaw richshaw added pipeline:merge pipeline:working A session is working on it right now and removed pipeline:review pipeline:working A session is working on it right now labels Nov 26, 2026 — with Claude
@richshaw
richshaw merged commit 501f077 into main Nov 26, 2026
5 checks passed
@richshaw
richshaw deleted the claude/issue-1083-test-locales branch November 26, 2026 02:28
@richshaw richshaw removed pipeline:merge pipeline:working A session is working on it right now labels Nov 26, 2026 — with Claude
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.

57 tests rebuild TEST_LOCALES by hand as CATALOG_LOCALES.filter(l => l !== 'en')

2 participants