From d896abb2833bfa0303715ca62642c4db62cd8491 Mon Sep 17 00:00:00 2001 From: Niraj Acharya Date: Wed, 22 May 2024 14:34:53 +0545 Subject: [PATCH] adding test for deleting/removing share link of project space using permission endpoint --- .../apiSharingNg/removeAccessToDrive.feature | 12 ++++++++++++ .../features/bootstrap/SharingNgContext.php | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature b/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature index 0cec5a60d58..c9549aa033c 100644 --- a/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature +++ b/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature @@ -215,3 +215,15 @@ Feature: Remove access to a drive | permissionsRole | internal | When user "Brian" tries to remove the link from space "NewSpace" owned by "Alice" using root endpoint of the Graph API Then the HTTP status code should be "500" + + + Scenario: remove link share of a project drive 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 the following space link share: + | space | projectSpace | + | permissionsRole | view | + | password | $heLlo*1234* | + When user "Alice" deletes the last link share of space "projectSpace" using permissions endpoint of the Graph API + Then the HTTP status code should be "204" \ No newline at end of file diff --git a/tests/acceptance/features/bootstrap/SharingNgContext.php b/tests/acceptance/features/bootstrap/SharingNgContext.php index a46c2c5b967..6e7a05eec28 100644 --- a/tests/acceptance/features/bootstrap/SharingNgContext.php +++ b/tests/acceptance/features/bootstrap/SharingNgContext.php @@ -1578,4 +1578,16 @@ public function userTriesToListThePermissionsOfSpaceOwnedByUsingRootEndpointOfTh ); $this->featureContext->setResponse($response); } + + /** + * @When user :user deletes the last link share of space :space using permissions endpoint of the Graph API + * + * @param string $user + * @param string $space + * + * @return void + */ + public function userDeletsTheLastLinkShareOfSpaceUsingPermissionsEndpointOfGraphApi(string $user, string $space):void { + $this->featureContext->setResponse($this->removeAccessToSpaceItem($user, 'link', $space, '')); + } }