Skip to content

Commit

Permalink
adding tests for sending a share invitation to a user on virtual drive
Browse files Browse the repository at this point in the history
  • Loading branch information
nirajacharya2 committed Mar 21, 2024
1 parent 84a14c5 commit f8f1484
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
49 changes: 48 additions & 1 deletion tests/acceptance/features/apiSharingNg/shareInvitations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2328,4 +2328,51 @@ Feature: Send a sharing invitations
| permissions-role |
| Space Viewer |
| Space Editor |
| Manager |
| Manager |

@issue-8495
Scenario Outline: send share invitations to a user on virtual space
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 |
2 changes: 1 addition & 1 deletion tests/acceptance/features/bootstrap/SharingNgContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function sendShareInvitation(string $user, TableNode $table, string $file
$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);
Expand Down

0 comments on commit f8f1484

Please sign in to comment.