From 6cf8546bf81b9e208051e15102d8951b7f38b667 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Fri, 26 Jan 2024 12:12:42 +0545 Subject: [PATCH] Added test for sending share invitation with empty sharetype (#8137) --- .../apiSharingNg/shareInvitations.feature | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/tests/acceptance/features/apiSharingNg/shareInvitations.feature b/tests/acceptance/features/apiSharingNg/shareInvitations.feature index 391a6d58f..85b4c60de 100644 --- a/tests/acceptance/features/apiSharingNg/shareInvitations.feature +++ b/tests/acceptance/features/apiSharingNg/shareInvitations.feature @@ -1386,3 +1386,103 @@ Feature: Send a sharing invitations | resource-type | path | | file | /textfile1.txt | | folder | FolderToShare | + + + Scenario Outline: send share invitation to user with empty recipient type + Given user "Alice" has uploaded file with content "to share" to "textfile1.txt" + And user "Alice" has created folder "FolderToShare" + When user "Alice" tries to send the following share invitation using the Graph API: + | resourceType | | + | resource | | + | space | Personal | + | sharee | Brian | + | shareType | | + | permissionsRole | Viewer | + 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": [ + "Key: 'DriveItemInvite.Recipients[0].LibreGraphRecipientType' Error:Field validation for 'LibreGraphRecipientType' failed on the 'oneof' tag" + ] + } + } + } + } + } + """ + Examples: + | resource-type | path | + | file | /textfile1.txt | + | folder | FolderToShare | + + + Scenario Outline: send share invitation to group with empty recipient type + Given user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file with content "to share" to "textfile1.txt" + And user "Alice" has created folder "FolderToShare" + And group "grp1" has been created + And the following users have been added to the following groups + | username | groupname | + | Brian | grp1 | + | Carol | grp1 | + When user "Alice" tries to send the following share invitation using the Graph API: + | resourceType | | + | resource | | + | space | Personal | + | sharee | grp1 | + | shareType | | + | permissionsRole | Viewer | + 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": [ + "Key: 'DriveItemInvite.Recipients[0].LibreGraphRecipientType' Error:Field validation for 'LibreGraphRecipientType' failed on the 'oneof' tag" + ] + } + } + } + } + } + """ + Examples: + | resource-type | path | + | file | /textfile1.txt | + | folder | FolderToShare |