add tests

This commit is contained in:
Mads Rasmussen
2024-04-09 09:59:38 +02:00
parent ed81c52517
commit 88545b9f95

View File

@@ -274,6 +274,22 @@ describe('UmbLocalizeController', () => {
});
});
describe('string', () => {
it('should replace words prefixed with a # with translated value', async () => {
const str = '#close';
const str2 = '#logout #close';
const str3 = '#logout #missing_translation_key #close';
expect(controller.string(str)).to.equal('Close');
expect(controller.string(str2)).to.equal('Log out Close');
expect(controller.string(str3)).to.equal('Log out #missing_translation_key Close');
});
it('should return the word with a # if the word is not found', async () => {
const str = '#missing_translation_key';
expect(controller.string(str)).to.equal('#missing_translation_key');
});
});
describe('host element', () => {
let element: UmbLocalizeControllerHostElement;