From 1a46104d505e6cde9b35efe50defd19ea02b7d8b Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Thu, 6 Jul 2023 19:48:32 +0200 Subject: chore: add actions testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/files/src/actions/viewInFolderAction.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'apps/files') diff --git a/apps/files/src/actions/viewInFolderAction.spec.ts b/apps/files/src/actions/viewInFolderAction.spec.ts index 693a24fb1da..887ed5d47c6 100644 --- a/apps/files/src/actions/viewInFolderAction.spec.ts +++ b/apps/files/src/actions/viewInFolderAction.spec.ts @@ -55,6 +55,19 @@ describe('View in folder action enabled tests', () => { expect(action.enabled!([file], view)).toBe(true) }) + test('Disabled without permissions', () => { + const file = new File({ + id: 1, + source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt', + owner: 'admin', + mime: 'text/plain', + permissions: Permission.NONE, + }) + + expect(action.enabled).toBeDefined() + expect(action.enabled!([file], view)).toBe(false) + }) + test('Disabled for non-dav ressources', () => { const file = new File({ id: 1, -- cgit v1.2.3