Compare commits

6 Commits
6 changed files with 876 additions and 844 deletions
+14
View File
@@ -1,3 +1,17 @@
#!/usr/bin/env pwsh #!/usr/bin/env pwsh
# Copyright 2026 Seekra
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
git config --local commit.template .gitmessage git config --local commit.template .gitmessage
+14
View File
@@ -1,3 +1,17 @@
#!/usr/bin/bash #!/usr/bin/bash
# Copyright 2026 Seekra
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
git config --local commit.template .gitmessage git config --local commit.template .gitmessage
@@ -39,7 +39,7 @@ vi.mock('@/features/icons/components/Icon.vue', () => ({
} }
})); }));
describe('LanguageSwitchButton.vue', () => { describe('LanguageSwitchButton', () => {
beforeEach(() => { beforeEach(() => {
vi.clearAllMocks(); vi.clearAllMocks();
localStorage.clear(); localStorage.clear();
@@ -17,6 +17,7 @@ limitations under the License.
import { describe, test, expect } from 'vitest'; import { describe, test, expect } from 'vitest';
import { validateSettingsConfig, validateEntry, validateSelectionOptions, assertType, assertString } from '../settingsValidator'; import { validateSettingsConfig, validateEntry, validateSelectionOptions, assertType, assertString } from '../settingsValidator';
describe('settingsValidator', () => {
describe('validateSettingsConfig', () => { describe('validateSettingsConfig', () => {
test.for([ test.for([
{ raw: false, expected: false }, { raw: false, expected: false },
@@ -756,3 +757,4 @@ describe('assertString', () => {
expect(() => assertString(value)).throws(Error); expect(() => assertString(value)).throws(Error);
}); });
}); });
});
+3 -1
View File
@@ -14,9 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { expect, test } from 'vitest'; import { describe, expect, test } from 'vitest';
import { ensureUnit } from '../cssDimensions'; import { ensureUnit } from '../cssDimensions';
describe('cssDimensions', () => {
test.for([ test.for([
{ dimension: null, expected: '0px' }, { dimension: null, expected: '0px' },
{ dimension: undefined, expected: '0px' }, { dimension: undefined, expected: '0px' },
@@ -120,3 +121,4 @@ test.for([
])('ensureUnit returns $expected with input $dimension', ({ dimension, expected }) => { ])('ensureUnit returns $expected with input $dimension', ({ dimension, expected }) => {
expect(ensureUnit(dimension)).toBe(expected); expect(ensureUnit(dimension)).toBe(expected);
}); });
});
+5 -5
View File
@@ -14,10 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { expect, test } from 'vitest'; import { describe, expect, test } from 'vitest';
import getCurrentLanguage from '../currentLanguage'; import getCurrentLanguage from '../currentLanguage';
const locales = [ describe('currentLanguage', () => {
test.for([
{ navigatorLanguage: 'en', localStorageLanguage: null, expected: 'en'}, { navigatorLanguage: 'en', localStorageLanguage: null, expected: 'en'},
{ navigatorLanguage: 'de', localStorageLanguage: null, expected: 'de'}, { navigatorLanguage: 'de', localStorageLanguage: null, expected: 'de'},
{ navigatorLanguage: 'fr', localStorageLanguage: null, expected: 'fr'}, { navigatorLanguage: 'fr', localStorageLanguage: null, expected: 'fr'},
@@ -45,9 +46,7 @@ const locales = [
{ navigatorLanguage: 'de-de', localStorageLanguage: 'en', expected: 'en'}, { navigatorLanguage: 'de-de', localStorageLanguage: 'en', expected: 'en'},
{ navigatorLanguage: 'zh-Hans-CN', localStorageLanguage: 'fr', expected: 'fr'}, { navigatorLanguage: 'zh-Hans-CN', localStorageLanguage: 'fr', expected: 'fr'},
{ navigatorLanguage: 'en-US-u-ca-gregory', localStorageLanguage: 'zh', expected: 'zh'} { navigatorLanguage: 'en-US-u-ca-gregory', localStorageLanguage: 'zh', expected: 'zh'}
]; ])('returns the language $expected (navigator: $navigatorLanguage; local storage: $localStorageLanguage)', ({ navigatorLanguage, localStorageLanguage, expected }) => {
test.for(locales)('returns the language $expected (navigator: $navigatorLanguage; local storage: $localStorageLanguage)', ({ navigatorLanguage, localStorageLanguage, expected }) => {
Object.defineProperty(navigator, 'language', { Object.defineProperty(navigator, 'language', {
value: navigatorLanguage, value: navigatorLanguage,
configurable: true configurable: true
@@ -59,3 +58,4 @@ test.for(locales)('returns the language $expected (navigator: $navigatorLanguage
expect(getCurrentLanguage()).toBe(expected); expect(getCurrentLanguage()).toBe(expected);
}); });
});