Skip to content

Commit

Permalink
added test to send share invitation to a deleted group
Browse files Browse the repository at this point in the history
  • Loading branch information
PrajwolAmatya committed Jan 10, 2024
1 parent 465c9e3 commit 10f1ecd
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
63 changes: 63 additions & 0 deletions tests/acceptance/features/apiSharingNg/shareInvitations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -774,3 +774,66 @@ Feature: Send a sharing invitations
| Co Owner | folder | FolderToShare |
| Uploader | folder | FolderToShare |
| Manager | folder | FolderToShare |


Scenario Outline: send sharing invitation to a deleted group with different roles
Given user "Carol" has been created with default attributes and without skeleton files
And group "grp1" has been created
And the following users have been added to the following groups
| username | groupname |
| Brian | grp1 |
| Carol | grp1 |
And user "Alice" has uploaded file with content "to share" to "/textfile1.txt"
And user "Alice" has created folder "FolderToShare"
And the administrator has deleted group "grp1"
When user "Alice" sends the following share invitation using the Graph API:
| resourceType | <resource-type> |
| resource | <path> |
| space | Personal |
| sharee | grp1 |
| shareType | group |
| permissionsRole | <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": [
"generalException"
]
},
"message": {
"type": "string",
"enum": [
"itemNotFound: not found"
]
}
}
}
}
}
"""
Examples:
| permissionsRole | resource-type | path |
| Viewer | file | /textfile1.txt |
| File Editor | file | /textfile1.txt |
| Co Owner | file | /textfile1.txt |
| Manager | file | /textfile1.txt |
| Viewer | folder | FolderToShare |
| Editor | folder | FolderToShare |
| Co Owner | folder | FolderToShare |
| Uploader | folder | FolderToShare |
| Manager | folder | FolderToShare |
13 changes: 13 additions & 0 deletions tests/acceptance/features/bootstrap/GraphContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,19 @@ public function userDeletesGroupUsingTheGraphApi(string $group, ?string $user =
$this->featureContext->setResponse($response);
}

/**
* @Given the administrator has deleted group :group
*
* @param string $group
*
* @return void
*/
public function theAdministratorHasDeletedGroupUsingGraphApi(string $group): void {
$groupId = $this->featureContext->getAttributeOfCreatedGroup($group, "id");
$response = $this->userDeletesGroupWithGroupId($groupId);
$this->featureContext->theHTTPStatusCodeShouldBe(204, "", $response);
}

/**
* @Then the following users should be listed in the following groups
*
Expand Down

0 comments on commit 10f1ecd

Please sign in to comment.