update tests for localize element

This commit is contained in:
Jacob Overgaard
2023-08-03 12:10:03 +02:00
parent 51ee931554
commit 5575d42d8f

View File

@@ -2,6 +2,7 @@ import { aTimeout, elementUpdated, expect, fixture, html } from '@open-wc/testin
import { umbTranslationRegistry } from '@umbraco-cms/backoffice/localization';
import { UmbLocalizeElement } from './localize.element.js';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
import { UmbLocalizeController } from '@umbraco-cms/backoffice/localization-api';
const english = {
type: 'translations',
@@ -60,6 +61,10 @@ describe('umb-localize', () => {
element = await fixture(html`<umb-localize key="general_close">Fallback value</umb-localize>`);
});
it('should have a localize controller', () => {
expect(element.localize).to.be.instanceOf(UmbLocalizeController);
});
it('should localize a key', async () => {
expect(element.shadowRoot?.innerHTML).to.contain('Close');
});