diff --git a/tests/acceptance/features/apiSharingNg/shareInvitations.feature b/tests/acceptance/features/apiSharingNg/shareInvitations.feature index 8209625d56..df1decf269 100644 --- a/tests/acceptance/features/apiSharingNg/shareInvitations.feature +++ b/tests/acceptance/features/apiSharingNg/shareInvitations.feature @@ -2328,4 +2328,51 @@ Feature: Send a sharing invitations | permissions-role | | Space Viewer | | Space Editor | - | Manager | \ No newline at end of file + | Manager | + + @issue-8495 + Scenario Outline: try to share Shares space with a user + When user "Alice" sends the following share invitation for space using the Graph API: + | space | Shares | + | 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", + "innererror", + "message" + ], + "properties": { + "code": { + "const": "invalidRequest" + }, + "innererror": { + "type": "object", + "required": [ + "date", + "request-id" + ] + }, + "message": { + "const": "" + } + } + } + } + } + """ + Examples: + | permissions-role | error-message | + | Space Viewer | space type is not eligible for sharing | + | Space Editor | space type is not eligible for sharing | + | Manager | space type is not eligible for sharing | + | Co Owner | Key: 'DriveItemInvite.Roles' Error:Field validation for 'Roles' failed on the 'available_role' tag | \ No newline at end of file diff --git a/tests/acceptance/features/bootstrap/SharingNgContext.php b/tests/acceptance/features/bootstrap/SharingNgContext.php index da488d132e..9b7f64d599 100644 --- a/tests/acceptance/features/bootstrap/SharingNgContext.php +++ b/tests/acceptance/features/bootstrap/SharingNgContext.php @@ -178,7 +178,7 @@ class SharingNgContext implements Context { $resource = $rows['resource'] ?? ''; // for a disabled and deleted space, resource id is not accessible, so get resource id from the saved response - if ($resource === '' && $rows['space'] !== 'Personal') { + if ($resource === '' && !\in_array($rows['space'], ['Personal', 'Shares'])) { $itemId = $space['fileId']; } else { $itemId = $this->spacesContext->getResourceId($user, $rows['space'], $resource);