Skip to content

Commit

Permalink
Add documentLocaleSettings to lang tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bearfriend committed Aug 31, 2023
1 parent 81b18dc commit 02ab688
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/browser/fixture.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
import { defineCE, expect, fixture, html, waitUntil } from '../../src/browser/index.js';
import { restore, stub } from 'sinon';
import { focusElem } from '../../src/browser/commands.js';
import { getDocumentLocaleSettings } from '@brightspace-ui/intl/lib/common.js';
import { LitElement } from 'lit';
import { requestMouseReset } from '../../src/browser/reset.js';
import { sendMouse } from '@web/test-runner-commands';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';

const documentLocaleSettings = getDocumentLocaleSettings();

const resolves = new Map();

const slowElem = defineCE(
Expand Down Expand Up @@ -132,13 +135,16 @@ describe('fixture', () => {
it('should default language to EN', async() => {
await fixture(html`<p>hello</p>`);
expect(document.documentElement.getAttribute('lang')).to.equal('en');
expect(documentLocaleSettings.language).to.equal('en');
});

it('should reset language to EN', async() => {
await fixture(html`<p>bonjour</p>`, { lang: 'fr' });
expect(document.documentElement.getAttribute('lang')).to.equal('fr');
expect(documentLocaleSettings.language).to.equal('fr');
await fixture(html`<p>hello</p>`);
expect(document.documentElement.getAttribute('lang')).to.equal('en');
expect(documentLocaleSettings.language).to.equal('en');
});

it('should use specified mathjax latex config', async() => {
Expand Down

0 comments on commit 02ab688

Please sign in to comment.