From 33360327c0c6902849b30c1f016d02efe7c17211 Mon Sep 17 00:00:00 2001 From: Prajwol Amatya <83579989+PrajwolAmatya@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:51:48 +0545 Subject: [PATCH] added test to share a resource with invalid roles (#8302) --- .../apiSharingNg/shareInvitations.feature | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/acceptance/features/apiSharingNg/shareInvitations.feature b/tests/acceptance/features/apiSharingNg/shareInvitations.feature index 85b4c60de2..4ebb73b78d 100644 --- a/tests/acceptance/features/apiSharingNg/shareInvitations.feature +++ b/tests/acceptance/features/apiSharingNg/shareInvitations.feature @@ -1486,3 +1486,54 @@ Feature: Send a sharing invitations | resource-type | path | | file | /textfile1.txt | | folder | FolderToShare | + + + Scenario Outline: try to share a resource with invalid roles + Given user "Alice" has uploaded file with content "to share" to "/textfile1.txt" + And user "Alice" has created folder "FolderToShare" + When user "Alice" sends the following share invitation using the Graph API: + | resourceType | | + | resource | | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + Then the HTTP status code should be "400" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "invalidRequest" + ] + }, + "message": { + "type": "string", + "enum": [ + "role not applicable to this resource" + ] + } + } + } + } + } + """ + Examples: + | permissions-role | resource-type | path | + | Co Owner | file | /textfile1.txt | + | Manager | file | /textfile1.txt | + | Co Owner | folder | FolderToShare | + | Manager | folder | FolderToShare |