Compare commits

1 Commits
Author SHA1 Message Date
jakob.scheidandGitea 59ffa4b043 chore(licenses): add license headers to setup scripts 2026-07-28 20:16:13 +02:00
4 changed files with 844 additions and 848 deletions
@@ -39,7 +39,7 @@ vi.mock('@/features/icons/components/Icon.vue', () => ({
}
}));
describe('LanguageSwitchButton', () => {
describe('LanguageSwitchButton.vue', () => {
beforeEach(() => {
vi.clearAllMocks();
localStorage.clear();
@@ -17,7 +17,6 @@ limitations under the License.
import { describe, test, expect } from 'vitest';
import { validateSettingsConfig, validateEntry, validateSelectionOptions, assertType, assertString } from '../settingsValidator';
describe('settingsValidator', () => {
describe('validateSettingsConfig', () => {
test.for([
{ raw: false, expected: false },
@@ -757,4 +756,3 @@ describe('settingsValidator', () => {
expect(() => assertString(value)).throws(Error);
});
});
});
+1 -3
View File
@@ -14,10 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { describe, expect, test } from 'vitest';
import { expect, test } from 'vitest';
import { ensureUnit } from '../cssDimensions';
describe('cssDimensions', () => {
test.for([
{ dimension: null, expected: '0px' },
{ dimension: undefined, expected: '0px' },
@@ -121,4 +120,3 @@ describe('cssDimensions', () => {
])('ensureUnit returns $expected with input $dimension', ({ dimension, expected }) => {
expect(ensureUnit(dimension)).toBe(expected);
});
});
+5 -5
View File
@@ -14,11 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { describe, expect, test } from 'vitest';
import { expect, test } from 'vitest';
import getCurrentLanguage from '../currentLanguage';
describe('currentLanguage', () => {
test.for([
const locales = [
{ navigatorLanguage: 'en', localStorageLanguage: null, expected: 'en'},
{ navigatorLanguage: 'de', localStorageLanguage: null, expected: 'de'},
{ navigatorLanguage: 'fr', localStorageLanguage: null, expected: 'fr'},
@@ -46,7 +45,9 @@ describe('currentLanguage', () => {
{ navigatorLanguage: 'de-de', localStorageLanguage: 'en', expected: 'en'},
{ navigatorLanguage: 'zh-Hans-CN', localStorageLanguage: 'fr', expected: 'fr'},
{ 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', {
value: navigatorLanguage,
configurable: true
@@ -58,4 +59,3 @@ describe('currentLanguage', () => {
expect(getCurrentLanguage()).toBe(expected);
});
});