[full-ci] [tests-only] Added api test for sharing spaces to group (#5023)

This commit is contained in:
Prarup Gurung
2022-12-14 14:13:55 +05:45
committed by GitHub
parent 51849c11f9
commit 6949dbd125
2 changed files with 26 additions and 4 deletions
@@ -167,3 +167,24 @@ Feature: Share spaces
| editor | viewer |
| viewer | manager |
| viewer | editor |
Scenario Outline: A user shares a space with a group
Given group "group2" has been created
And the administrator has added a user "Brian" to the group "group2" using GraphApi
And the administrator has added a user "Bob" to the group "group2" using GraphApi
When user "Alice" shares a space "share space" to group "group2" with role "<role>"
Then the HTTP status code should be "200"
And the user "Brian" should have a space called "share space" with these key and value pairs:
| key | value |
| driveType | project |
| name | share space |
And the user "Bob" should have a space called "share space" with these key and value pairs:
| key | value |
| driveType | project |
| name | share space |
Examples:
| role |
| manager |
| editor |
| viewer |
@@ -1353,7 +1353,7 @@ class SpacesContext implements Context {
"Expected response status code should be 200"
);
}
/**
* @When /^user "([^"]*)" sets the file "([^"]*)" as a (description|space image)\s? in a special section of the "([^"]*)" space$/
*
@@ -1775,11 +1775,12 @@ class SpacesContext implements Context {
/**
* @When /^user "([^"]*)" shares a space "([^"]*)" to user "([^"]*)" with role "([^"]*)"$/
* @When /^user "([^"]*)" shares a space "([^"]*)" to group "([^"]*)" with role "([^"]*)"$/
* @When /^user "([^"]*)" updates the space "([^"]*)" for user "([^"]*)" changing the role to "([^"]*)"$/
*
* @param string $user
* @param string $spaceName
* @param string $userRecipient
* @param string $recipient
* @param string $role
*
* @return void
@@ -1788,7 +1789,7 @@ class SpacesContext implements Context {
public function sendShareSpaceRequest(
string $user,
string $spaceName,
string $userRecipient,
string $recipient,
string $role
): void {
$space = $this->getSpaceByName($user, $spaceName);
@@ -1799,7 +1800,7 @@ class SpacesContext implements Context {
$body = [
"space_ref" => $space['id'],
"shareType" => 7,
"shareWith" => $userRecipient,
"shareWith" => $recipient,
"role" => $role // role overrides the permissions parameter
];