aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-07-06 19:48:32 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-07-11 13:52:28 +0200
commit1a46104d505e6cde9b35efe50defd19ea02b7d8b (patch)
treecc549f69922c52b7556edb7cf9f7462e12404b88 /apps/files
parent2d6e50a8dbb075b533b31de91f015f636cc40f4e (diff)
downloadnextcloud-server-1a46104d505e6cde9b35efe50defd19ea02b7d8b.tar.gz
nextcloud-server-1a46104d505e6cde9b35efe50defd19ea02b7d8b.zip
chore: add actions testing
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/src/actions/viewInFolderAction.spec.ts13
1 files changed, 13 insertions, 0 deletions
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,