Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdoming committed Jan 18, 2025
1 parent 97c4839 commit 16c8325
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/desktop-client/src/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ describe('setI18NextLanguage', () => {
afterEach(vi.unstubAllGlobals);

test('should set system default language when no language is provided', () => {
vi.stubGlobal('navigator', { language: 'fr' });
vi.stubGlobal('navigator', { language: 'uk' });

setI18NextLanguage('');

expect(i18n.changeLanguage).toHaveBeenCalledWith('fr');
expect(i18n.changeLanguage).toHaveBeenCalledWith('uk');
});

test('should set the provided language if it is available', () => {
Expand Down Expand Up @@ -60,12 +60,12 @@ describe('setI18NextLanguage', () => {
test('should fallback to base language if the provided language has an unknown region code', () => {
vi.spyOn(console, 'error');

setI18NextLanguage('fr-ZZ');
setI18NextLanguage('uk-ZZ');

expect(console.error).toHaveBeenCalledWith(
'Unknown locale fr-ZZ, falling back to fr',
'Unknown locale uk-ZZ, falling back to uk',
);
expect(i18n.changeLanguage).toHaveBeenCalledWith('fr');
expect(i18n.changeLanguage).toHaveBeenCalledWith('uk');
});

test('should fallback to lowercase language if the provided language has uppercase letters', () => {
Expand Down

0 comments on commit 16c8325

Please sign in to comment.