add tests to localize controller
This commit is contained in:
@@ -97,10 +97,9 @@ describe('UmbLocalizeController', () => {
|
||||
expect(element.localize.term('general_logout')).to.equal('Log out');
|
||||
});
|
||||
|
||||
// TODO: fix this test
|
||||
// it('should override a term', async () => {
|
||||
// umbExtensionsRegistry.register(englishOverride);
|
||||
// await aTimeout(0);
|
||||
// expect(element.localize.term('general_close')).to.equal('Close 2');
|
||||
// });
|
||||
it('should override a term', async () => {
|
||||
umbExtensionsRegistry.register(englishOverride);
|
||||
await aTimeout(0);
|
||||
expect(element.localize.term('general_close')).to.equal('Close 2');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -75,7 +75,6 @@ export class UmbLocalizeController<UserTranslation extends Translation = Default
|
||||
} else if (fallback && fallback[key as keyof Translation]) {
|
||||
term = fallback[key as keyof Translation];
|
||||
} else {
|
||||
console.error(`No translation found for: ${String(key)}`);
|
||||
return String(key);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user