adding tests for sending a share invitation to a user on virtual drive (#8705)

This commit is contained in:
nirajacharya2
2024-03-22 17:28:46 +05:45
committed by GitHub
parent d14a8c0994
commit 208b25c7ed
2 changed files with 49 additions and 2 deletions
@@ -2328,4 +2328,51 @@ Feature: Send a sharing invitations
| permissions-role |
| Space Viewer |
| Space Editor |
| Manager |
| 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 | <permissions-role> |
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": "<error-message>"
}
}
}
}
}
"""
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 |
@@ -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);