diff --git a/__tests__/utils/fileSize.spec.ts b/__tests__/utils/fileSize.spec.ts index e8d396b17..cb802cb54 100644 --- a/__tests__/utils/fileSize.spec.ts +++ b/__tests__/utils/fileSize.spec.ts @@ -2,11 +2,13 @@ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { describe, expect, it } from 'vitest' +import { beforeEach, describe, expect, it } from 'vitest' import { formatFileSize, parseFileSize } from '../../lib/index' +import { setLocale } from '@nextcloud/l10n' describe('humanFileSize', () => { + beforeEach(() => setLocale('en')) describe('formatFileSize', () => { it('renders binary size with decimal units by default', () => { expect(formatFileSize(2048)).toBe('2 KB') @@ -79,7 +81,7 @@ describe('humanFileSize', () => { }) it('renders file sizes with the correct locale', function() { - document.documentElement.dataset.locale = 'de' + setLocale('de') const dataDecimal = [ [0, '0 B'], ['0', '0 B'], diff --git a/package-lock.json b/package-lock.json index 14737c127..9f222c5ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@nextcloud/auth": "^2.5.2", "@nextcloud/capabilities": "^1.2.0", - "@nextcloud/l10n": "^3.3.0", + "@nextcloud/l10n": "^3.4.0", "@nextcloud/logger": "^3.0.2", "@nextcloud/paths": "^2.2.1", "@nextcloud/router": "^3.0.1", @@ -1561,9 +1561,9 @@ } }, "node_modules/@nextcloud/l10n": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-3.3.0.tgz", - "integrity": "sha512-gPvAf5gzqxjnk8l6kr8LQTMN3lv5CLN8tTWwMfavmTbPsKj2/ZUjZhwIm3PcZ3xvJzBi7Ttgrf9xz5cT6CGsWg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-3.4.0.tgz", + "integrity": "sha512-K4UBSl0Ou6sXXLxyjuhktRf2FyTCjyvHxJyBLmS2z3YEYcRkpf8ib3XneRwEQIEpzBPQjul2/ZdFlt7umd8Gaw==", "license": "GPL-3.0-or-later", "dependencies": { "@nextcloud/router": "^3.0.1", @@ -1573,8 +1573,7 @@ "escape-html": "^1.0.3" }, "engines": { - "node": "^22.0.0", - "npm": "^10.5.1" + "node": "^20 || ^22 || ^24" } }, "node_modules/@nextcloud/logger": { @@ -4019,9 +4018,9 @@ "integrity": "sha512-A/8PwLk/T7IJDfUdQ68NR24QHa8rIlnN/stiJEBo6dmVUkD4K14LswG0w3VwdeK/o7qOwRUR1k2MhK5Rpy2m7A==" }, "node_modules/caniuse-lite": { - "version": "1.0.30001692", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001692.tgz", - "integrity": "sha512-A95VKan0kdtrsnMubMKxEKUKImOPSuCpYgxSQBo036P5YYgVIcOYJEgt/txJWqObiRQeISNCfef9nvlQ0vbV7A==", + "version": "1.0.30001731", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001731.tgz", + "integrity": "sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg==", "dev": true, "funding": [ { @@ -4036,7 +4035,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/chai": { "version": "5.2.0", diff --git a/package.json b/package.json index e57883f46..f7ef713d5 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "dependencies": { "@nextcloud/auth": "^2.5.2", "@nextcloud/capabilities": "^1.2.0", - "@nextcloud/l10n": "^3.3.0", + "@nextcloud/l10n": "^3.4.0", "@nextcloud/logger": "^3.0.2", "@nextcloud/paths": "^2.2.1", "@nextcloud/router": "^3.0.1",