🧪 [testing improvement] Add unit tests for i18n translation functions#5
🧪 [testing improvement] Add unit tests for i18n translation functions#5chuanman2707 wants to merge 4 commits into
Conversation
…le management Co-authored-by: chuanman2707 <29907469+chuanman2707@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
…le management Also fixes a Clippy warning (`clippy::unnecessary_sort_by`) in `groups.rs` by changing `.sort_by(|a, b| b.1.len().cmp(&a.1.len()))` to `.sort_by_key(|b| std::cmp::Reverse(b.1.len()))`. Co-authored-by: chuanman2707 <29907469+chuanman2707@users.noreply.github.com>
…le management Also fixes a Clippy warning (`clippy::unnecessary_sort_by`) in `groups.rs` by changing `.sort_by(|a, b| b.1.len().cmp(&a.1.len()))` to `.sort_by_key(|b| std::cmp::Reverse(b.1.len()))`. Co-authored-by: chuanman2707 <29907469+chuanman2707@users.noreply.github.com>
|
This one is worth keeping, but not merging as-is. The i18n tests are useful, however the PR also includes an unrelated |
I have removed the unrelated |
…le management Co-authored-by: chuanman2707 <29907469+chuanman2707@users.noreply.github.com>
🎯 What: The testing gap addressed
Tests were added for the internationalization (i18n) functions in
mhm/src/lib/i18n.ts, includingt(),setLocale(), andgetLocale().📊 Coverage: What scenarios are now tested
t()function translating standard keys.t()function responding correctly when locale is changed.t()falling back to the translation key when a key is not found.t()falling back to default language (vi) when the translation for the current locale is missing.✨ Result: The improvement in test coverage
The critical
tfunction used heavily throughout the app is now fully unit tested, improving coverage and preventing regressions during future refactors or translation updates.PR created automatically by Jules for task 11278824115162357285 started by @chuanman2707