test: keep the locale tests independent of which overlay keys are translated

This commit is contained in:
Linus Rath
2026-09-24 20:07:00 +02:00
parent edab181e60
commit e0a79ca5c6
+5 -3
View File
@@ -53,8 +53,10 @@ describe('translate', () => {
expect(many).toBe('3 emails selected');
});
it('serves RN-only overlay keys in every locale via the en fallback', () => {
expect(translate('fr', 'email_list.no_trash_folder')).toContain('Trash');
it('serves RN-only overlay keys in every locale', () => {
const french = translate('fr', 'email_list.no_trash_folder');
expect(french).not.toBe('email_list.no_trash_folder');
expect(french).not.toBe('');
});
});
@@ -68,7 +70,7 @@ describe('catalog loading', () => {
expect(i18n.loadedLocales().sort()).toEqual(['de']);
// A key German lacks falls through to English, which is built then.
i18n.translate('de', 'email_list.no_trash_folder');
i18n.translate('de', 'nope.missing');
expect(i18n.loadedLocales().sort()).toEqual(['de', 'en']);
// Switching language loads the new catalog synchronously.