Skip to content

test(i18n): add unit tests for sanitizer#17654

Merged
wackerow merged 3 commits into
devfrom
add-sanitizer-tests
Feb 26, 2026
Merged

test(i18n): add unit tests for sanitizer#17654
wackerow merged 3 commits into
devfrom
add-sanitizer-tests

Conversation

@myelinated-wackerow
Copy link
Copy Markdown
Collaborator

Note: This PR targets fix-review-translations, not dev. Merge the base PR first.

Summary

  • Add 99 unit tests for the post-import translation sanitizer across 4 test files
  • Add _testOnly export to sanitizer for unit test access (zero runtime impact)
  • Document 11 new translation artifact patterns from PR analysis across 10+ languages
  • Add /fix-sanitizer-bug command for guided test-first sanitizer iteration

Test files

File Tests Coverage
standalone-fixes.spec.ts 50 Pure functions (no English source needed)
english-comparison.spec.ts 27 Functions comparing translated vs English
warnings.spec.ts 13 Warn-only detection functions
integration.spec.ts 9 End-to-end processMarkdownFile/processJsonFile

Test plan

  • npx playwright test --project=unit tests/unit/sanitizer/ -- 99 passed
  • npx playwright test --project=unit -- all unit tests pass (including existing getters)
  • No changes to playwright.config.ts or other config
  • Production sanitizer behavior unchanged

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Co-Authored-By: wackerow 54227730+wackerow@users.noreply.github.com

myelinated-wackerow and others added 3 commits February 25, 2026 05:58
Documents 11 new translation artifact patterns found across 10+ PRs (zh-tw, sw, ta, bn, ur, de, ja, zh, es, tr) to inform future sanitizer improvements and test coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Adds _testOnly export to expose internal functions for testing (zero runtime impact). Four test files cover standalone fixes, English-comparison fixes, warning functions, and integration through processMarkdownFile/processJsonFile.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Guided workflow for iterating on sanitizer bugs: triage (fix vs warn vs document-only), test-first development, cross-language verification, and conditional build checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
@github-actions github-actions Bot added documentation 📖 Change or add documentation tooling 🔧 Changes related to tooling of the project labels Feb 25, 2026
wackerow added a commit that referenced this pull request Feb 25, 2026
Document full review-translations-local pipeline results:
- Quality score 7.2/10 across 28 Czech files
- 14 issues fixed (MDX syntax, acronyms, URLs, typos)
- Key decisions: DNZ->ZKP rationale, glossary deviation deferral
- Sanitizer crash on orphaned Crowdin paths documented
- Content staleness in 3 roadmap files flagged for retranslation
- Prevention strategies and suggested test cases for PR #17654

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Copy link
Copy Markdown
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from fix-review-translations to dev February 26, 2026 22:43
@wackerow wackerow merged commit 3ad67c0 into dev Feb 26, 2026
4 checks passed
@wackerow wackerow deleted the add-sanitizer-tests branch February 26, 2026 22:43
@pettinarip pettinarip mentioned this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation 📖 Change or add documentation tooling 🔧 Changes related to tooling of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants