From 8c79b842fc877cb90688b1d43de67711a78a7b61 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Wed, 18 Dec 2024 11:58:56 +0100 Subject: [PATCH] feat: Upgrade cozy-viewer --- package.json | 2 +- src/modules/public/LightFileViewer.spec.jsx | 6 +++++- yarn.lock | 8 ++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 09a6d97d79..c30ad8b849 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "cozy-sharing": "^16.17.0", "cozy-stack-client": "^51.6.0", "cozy-ui": "^114.0.1", - "cozy-viewer": "^9.0.2", + "cozy-viewer": "^9.1.0", "date-fns": "1.30.1", "diacritics": "1.3.0", "filesize": "10.1.6", diff --git a/src/modules/public/LightFileViewer.spec.jsx b/src/modules/public/LightFileViewer.spec.jsx index 31c5fb8ce1..daf2e6b0f1 100644 --- a/src/modules/public/LightFileViewer.spec.jsx +++ b/src/modules/public/LightFileViewer.spec.jsx @@ -11,7 +11,6 @@ jest.mock('cozy-keys-lib', () => ({ ...jest.requireActual('cozy-keys-lib'), useVaultClient: jest.fn() })) - jest.mock('cozy-intent', () => ({ WebviewIntentProvider: ({ children }) => children, useWebviewIntent: () => ({ call: () => {} }) @@ -21,6 +20,11 @@ jest.mock('cozy-ui/transpiled/react/providers/Breakpoints', () => ({ default: jest.fn(), BreakpointsProvider: ({ children }) => children })) +// used inside cozy-viewer +jest.mock('cozy-client/dist/models/permission', () => ({ + ...jest.requireActual('cozy-client/dist/models/permission'), + isDocumentReadOnly: jest.fn().mockResolvedValue(false) +})) const client = new createMockClient({}) diff --git a/yarn.lock b/yarn.lock index 1f6022759a..14647b6dc4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6647,10 +6647,10 @@ cozy-ui@^114.0.1: react-swipeable-views "^0.13.3" rooks "^5.11.2" -cozy-viewer@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/cozy-viewer/-/cozy-viewer-9.0.2.tgz#f618f5296b7637a96f9017327fb2bbff85b06f38" - integrity sha512-VhB7m1EIOW8oL67+PT38Miw+n1YFEBKgQAcVJMN8Yo6otNi0rTiqKuPSnbmLbhI+J88TWKK68Z0E2JBX1UOZyQ== +cozy-viewer@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/cozy-viewer/-/cozy-viewer-9.1.0.tgz#13b1bc573076f676ac5f73b98620ef55ebfb7e88" + integrity sha512-X1HjMuCYJNLV9fW5aRVlkwloQbOaxcnsSETaacPJXzxXMyPqDkyuNT1HLqXDWCU5y8WGankMMGJtp9iGre94bg== dependencies: classnames "^2.2.5" hammerjs "^2.0.8"