Skip to content

Commit

Permalink
fix: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Sep 11, 2024
1 parent 628a109 commit c8b8189
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/elements/core/controllers/language-controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,4 @@ describe('LanguageController', () => {
await aTimeout(0);
expect(state.counter).to.equal(2);
});

// This test can only be run in isolation, as LanguageController has global state.
// It is possible to verify this test by switching it to it.only.
// eslint-disable-next-line no-constant-condition
if (!'must be run in isolation') {
it('should only update language if connected', async () => {
document.documentElement.setAttribute('lang', 'fr');
await aTimeout(0);
expect(controller.current).to.equal('fr', 'Language should be detected when connected');
controller.hostDisconnected();

document.documentElement.setAttribute('lang', 'en');
await aTimeout(0);

expect(controller.current).to.equal('fr', 'Language should not be update when disconnected');

controller.hostConnected();
expect(controller.current).to.equal(
'en',
'Language should immediately be update when connected',
);
});
}
});

0 comments on commit c8b8189

Please sign in to comment.