From ee5a8c049f9e2f6cc861f29c9f13fb4b858b38f8 Mon Sep 17 00:00:00 2001 From: Niraj Acharya Date: Fri, 31 May 2024 12:36:14 +0545 Subject: [PATCH] adding test for updating share link of a folder in personal space using permission endpoint --- ...ected-failures-localAPI-on-OCIS-storage.md | 1 + .../apiSharingNgLinkShare/linkShare.feature | 86 +++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index e16fb4f6745..26f15792242 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -269,6 +269,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiSharingNgLinkShare/linkShare.feature:2736](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2736) - [apiSharingNgLinkShare/linkShare.feature:2804](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2804) - [apiSharingNgLinkShare/linkShare.feature:2890](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L2890) +- [apiSharingNgLinkShare/linkShare.feature:3277](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature#L3277) - [apiSharingNg/removeAccessToDriveItem.feature:125](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/removeAccessToDriveItem.feature#L125) - [apiSharingNg/removeAccessToDriveItem.feature:141](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/removeAccessToDriveItem.feature#L141) - [apiSharingNg/removeAccessToDriveItem.feature:161](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/removeAccessToDriveItem.feature#L161) diff --git a/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature b/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature index 5fa771a8b35..c884f732549 100644 --- a/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature +++ b/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature @@ -3190,3 +3190,89 @@ Feature: Create a share link for a resource | edit | internal | | upload | internal | | createOnly | internal | + + + + Scenario Outline: update link share of a folder inside personal drive using permissions endpoint + Given user "Alice" has created folder "folder" + And user "Alice" has created the following resource link share: + | space | Personal | + | resource | folder | + | permissionsRole | | + | password | %public% | + | displayName | Homework | + When user "Alice" updates the last public link share using the permissions endpoint of the Graph API: + | space | Personal | + | resource | folder | + | permissionsRole | | + | password | p@$$w0rD | + | expirationDateTime | 2201-07-15T14:00:00Z | + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "hasPassword", + "id", + "link", + "expirationDateTime", + "createdDateTime" + ], + "properties": { + "hasPassword": { + "const": true + }, + "id": { + "type": "string", + "pattern": "^[a-zA-Z]{15}$" + }, + "expirationDateTime": { + "const": "2201-07-15T23:59:59Z" + }, + "link": { + "type": "object", + "required": [ + "@libre.graph.displayName", + "@libre.graph.quickLink", + "preventsDownload", + "type", + "webUrl" + ], + "properties": { + "@libre.graph.displayName": { + "const": "Homework" + }, + "@libre.graph.quickLink": { + "const": false + }, + "preventsDownload": { + "const": false + }, + "type": { + "const": "" + }, + "webUrl": { + "type": "string", + "pattern": "^%base_url%/s/[a-zA-Z]{15}$" + } + } + } + } + } + """ + Examples: + | permissions-role | new-permissions-role | + | view | edit | + | view | upload | + | view | createOnly | + | edit | view | + | edit | upload | + | edit | createOnly | + | upload | view | + | upload | edit | + | upload | createOnly | + | createOnly | view | + | createOnly | edit | + | createOnly | upload | + | blocksDownload | blocksDownload | \ No newline at end of file