Skip to content

test(i18n): preserve fallback coverage as catalogs gain translations - #25468

Closed
nwparker wants to merge 1 commit into
mainfrom
nwparker/editor-locale-test-assumptions
Closed

nwparker wants to merge 1 commit into
mainfrom
nwparker/editor-locale-test-assumptions

Conversation

@nwparker

@nwparker nwparker commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​48 $\color{#cf222e}{\Huge{\mathbf{−}}}$​9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​39
Prod 0 0 0 0

ELI5

Translation updates made six tests fail because they required Spanish to lack a label and required every language to show English discard warnings. The tests now verify a controlled missing-locale fallback and the actual translated warnings.

What Changed

Two test files only. The agent-label fallback uses an unknown test locale, so adding a real translation cannot invalidate its premise. Discard-warning cases contain explicit expected text for each supported locale, including the distinction between working changes and the staged version.

Why

Keep meaningful fallback and warning coverage while allowing translated catalogs to improve. Removing these assertions or reverting translations would lose useful behavior.

Linked Issue

N/A; repairs existing-main CI failures affecting editor PRs, including #25407, #25417, #25429, #25431, #25437 and #25444.

Visual Proof

N/A; tests only, no application behavior changes.

Testing

  • Automated tests updated
  • Manual UI test; not needed for test-only changes

All 12 tests in both affected suites pass with real catalogs. Renderer typecheck, full repository lint, changed-code quality and formatting pass. No runtime build was needed. Published-head CI pending.

Review

Checked the real lazy-locale backend, translate fallback and both production callers. The expected warning text is explicit rather than computed by the function under test. The locale resets to English after each case.

Agent skill upstream boundary

  • Not applicable; no skill source copied.

Notes

Merge risk: very low. No production changes, dependency changes or negative user-facing trade-offs. Test behavior is platform-independent; no filesystem, SSH or wire changes.

Checklist

  • Small and focused
  • Behavior, mechanism and alternatives explained
  • No application visual change
  • Correctness and source review completed
  • Platform and SSH impact considered
  • Relevant tests, renderer typecheck, lint, quality and formatting passed

Use a missing test locale for the native agent fallback and assert localized discard descriptions instead of requiring English in every catalog.
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fd8928ee-a12f-414c-bf20-29f68b94cc7d
📥 Commits

Reviewing files that changed from the base of the PR and between 2b0ce17 and df23cf9.

📒 Files selected for processing (2)
  • src/renderer/src/components/right-sidebar/source-control-discard-localization.test.ts
  • src/renderer/src/components/settings/NativeChatSupportedAgents.test.tsx
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker

nwparker commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by current main. Both test corrections are already present there: the Supported Agents fallback test now uses an explicitly empty isolated locale, and the discard tests assert the real translated descriptions.

Verified the current-main versions with all 12 tests passing in these two suites. The isolated locale on main is more explicit than this PR's unused-locale choice, so I am keeping that implementation and closing this duplicate test-only PR.

Current source: Supported Agents test, discard localization test. No production changes are being dropped.

@nwparker nwparker closed this Oct 5, 2026
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