From b870c0df1257e42ab100eaf5d00827e5fe916db5 Mon Sep 17 00:00:00 2001 From: Prashant Gurung <53248463+prashant-gurung899@users.noreply.github.com> Date: Tue, 4 Jun 2024 09:25:39 +0545 Subject: [PATCH] Add test for updating link of a folder in project-space (#9300) --- .../apiSharingNgLinkShare/linkShare.feature | 86 ++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature b/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature index 1231a60e58e..3856fb11c35 100644 --- a/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature +++ b/tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature @@ -2886,4 +2886,88 @@ Feature: Create a share link for a resource | createOnly | view | | createOnly | edit | | createOnly | upload | - | blocksDownload | blocksDownload | \ No newline at end of file + | blocksDownload | blocksDownload | + + + Scenario Outline: update link share of a folder inside project-space using permissions endpoint + Given using spaces DAV path + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "projectSpace" with the default quota using the Graph API + And user "Alice" has created a folder "folderToShare" in space "projectSpace" + And user "Alice" has created the following resource link share: + | resource | folderToShare | + | space | projectSpace | + | permissionsRole | | + | displayName | Link | + | password | %public% | + When user "Alice" updates the last public link share using the permissions endpoint of the Graph API: + | resource | folderToShare | + | space | projectSpace | + | permissionsRole | | + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "hasPassword", + "id", + "link", + "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": "Link" + }, + "@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 |