diff --git a/package-lock.json b/package-lock.json index f7d45d19845..f18021c1d73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@nextcloud/capabilities": "^1.0.4", "@nextcloud/dialogs": "^3.2.0", "@nextcloud/event-bus": "^3.0.1", - "@nextcloud/initial-state": "^1.2.1", + "@nextcloud/initial-state": "^2.0.0", "@nextcloud/l10n": "^1.6.0", "@nextcloud/moment": "^1.2.1", "@nextcloud/paths": "^2.1.0", @@ -3151,6 +3151,14 @@ "core-js": "^3.6.4" } }, + "node_modules/@nextcloud/capabilities/node_modules/@nextcloud/initial-state": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-1.2.1.tgz", + "integrity": "sha512-2TH2DzJBolYHWfbSovTWkByAIg0gdsyuVfZpf5APnJu/9PixXKbnrVFnaEdxjeP262Gok7ARMFFQeSiuzKRQeQ==", + "dependencies": { + "core-js": "^3.6.4" + } + }, "node_modules/@nextcloud/dialogs": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@nextcloud/dialogs/-/dialogs-3.2.0.tgz", @@ -3256,12 +3264,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/@nextcloud/initial-state": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-1.2.1.tgz", - "integrity": "sha512-2TH2DzJBolYHWfbSovTWkByAIg0gdsyuVfZpf5APnJu/9PixXKbnrVFnaEdxjeP262Gok7ARMFFQeSiuzKRQeQ==", - "dependencies": { - "core-js": "^3.6.4" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.0.0.tgz", + "integrity": "sha512-xmNP30v/RnkJ2z1HcuEo7YfcLJJa+FdWTwgNldXHOlMeMbl/ESpsGkWL2sULrhYurz64L0JpfwEdi/cHcmyuZQ==" }, "node_modules/@nextcloud/l10n": { "version": "1.6.0", @@ -3642,11 +3647,6 @@ "uuid": "^8.3.2" } }, - "node_modules/@nextcloud/vue/node_modules/@nextcloud/initial-state": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.0.0.tgz", - "integrity": "sha512-xmNP30v/RnkJ2z1HcuEo7YfcLJJa+FdWTwgNldXHOlMeMbl/ESpsGkWL2sULrhYurz64L0JpfwEdi/cHcmyuZQ==" - }, "node_modules/@nextcloud/vue/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", @@ -24096,6 +24096,16 @@ "requires": { "@nextcloud/initial-state": "^1.1.2", "core-js": "^3.6.4" + }, + "dependencies": { + "@nextcloud/initial-state": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-1.2.1.tgz", + "integrity": "sha512-2TH2DzJBolYHWfbSovTWkByAIg0gdsyuVfZpf5APnJu/9PixXKbnrVFnaEdxjeP262Gok7ARMFFQeSiuzKRQeQ==", + "requires": { + "core-js": "^3.6.4" + } + } } }, "@nextcloud/dialogs": { @@ -24168,12 +24178,9 @@ } }, "@nextcloud/initial-state": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-1.2.1.tgz", - "integrity": "sha512-2TH2DzJBolYHWfbSovTWkByAIg0gdsyuVfZpf5APnJu/9PixXKbnrVFnaEdxjeP262Gok7ARMFFQeSiuzKRQeQ==", - "requires": { - "core-js": "^3.6.4" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.0.0.tgz", + "integrity": "sha512-xmNP30v/RnkJ2z1HcuEo7YfcLJJa+FdWTwgNldXHOlMeMbl/ESpsGkWL2sULrhYurz64L0JpfwEdi/cHcmyuZQ==" }, "@nextcloud/l10n": { "version": "1.6.0", @@ -24330,11 +24337,6 @@ "integrity": "sha512-Uy/etWwRmbzG1jxcfampOCEXbGMEzY1xVCBlONVrkusUmD9t02u3jWFkRJGAHvFAtLd4iM+MdTo1x3VXemBvcA==", "requires": {} }, - "@nextcloud/initial-state": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.0.0.tgz", - "integrity": "sha512-xmNP30v/RnkJ2z1HcuEo7YfcLJJa+FdWTwgNldXHOlMeMbl/ESpsGkWL2sULrhYurz64L0JpfwEdi/cHcmyuZQ==" - }, "ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", diff --git a/package.json b/package.json index f3013d3f92e..45f7259e521 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@nextcloud/capabilities": "^1.0.4", "@nextcloud/dialogs": "^3.2.0", "@nextcloud/event-bus": "^3.0.1", - "@nextcloud/initial-state": "^1.2.1", + "@nextcloud/initial-state": "^2.0.0", "@nextcloud/l10n": "^1.6.0", "@nextcloud/moment": "^1.2.1", "@nextcloud/paths": "^2.1.0", diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js index 7ac91e77a64..f6dcd6b8dec 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.spec.js @@ -4,13 +4,13 @@ import { createLocalVue, shallowMount } from '@vue/test-utils' import { cloneDeep } from 'lodash' import storeConfig from '../../../../../store/storeConfig.js' import { imagePath, generateRemoteUrl } from '@nextcloud/router' -import { loadState } from '@nextcloud/initial-state' +import { getCapabilities } from '@nextcloud/capabilities' import PlayCircleOutline from 'vue-material-design-icons/PlayCircleOutline.vue' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import FilePreview from './FilePreview.vue' -jest.mock('@nextcloud/initial-state', () => ({ - loadState: jest.fn(), +jest.mock('@nextcloud/capabilities', () => ({ + getCapabilities: jest.fn(), })) describe('FilePreview.vue', () => { @@ -230,19 +230,16 @@ describe('FilePreview.vue', () => { propsData.name = 'test %20.gif' propsData.path = 'path/to/test %20.gif' - loadState.mockImplementation((app, key) => { - if (app === 'core' && key === 'capabilities') { - return { - spreed: { - config: { - previews: { - 'max-gif-size': 1024, - }, + getCapabilities.mockImplementation(() => { + return { + spreed: { + config: { + previews: { + 'max-gif-size': 1024, }, }, - } + }, } - return null }) }) test('directly renders small GIF files', async () => {