diff --git a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature index 3ce7b96bd..254ab8a7e 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature @@ -294,7 +294,7 @@ Feature: Share spaces | role | viewer | When user "Brian" uploads a file inside space "share space" with content "Test" to "test.txt" using the WebDAV API Then the HTTP status code should be "403" - When user "Alice" has shared a space "share space" with settings: + When user "Alice" shares a space "share space" with settings: | shareWith | Brian | | role | editor | Then the HTTP status code should be "200" @@ -310,7 +310,7 @@ Feature: Share spaces | role | viewer | When user "Brian" uploads a file inside space "share space" with content "Test" to "test.txt" using the WebDAV API Then the HTTP status code should be "403" - When user "Alice" has shared a space "share space" with settings: + When user "Alice" shares a space "share space" with settings: | shareWith | sales | | shareType | 8 | | role | editor | @@ -347,4 +347,44 @@ Feature: Share spaces | role | | manager | | editor | - | viewer | \ No newline at end of file + | viewer | + + + Scenario Outline: update the expiration date of a space in user share + Given user "Alice" has shared a space "share space" with settings: + | shareWith | Brian | + | role | | + | expireDate | 2042-03-25T23:59:59+0100 | + When user "Alice" updates the space "share space" with settings: + | shareWith | Brian | + | expireDate | 2044-01-01T23:59:59.999+01:00 | + | role | | + Then the HTTP status code should be "200" + And the user "Brian" should have a space called "share space" granted to user "Brian" with role "" and expiration date "2044-01-01" + Examples: + | role | + | manager | + | editor | + | viewer | + + + Scenario Outline: update the expiration date of a space in group share + Given group "sales" has been created + And the administrator has added a user "Brian" to the group "sales" using GraphApi + And user "Alice" has shared a space "share space" with settings: + | shareWith | sales | + | shareType | 8 | + | role | | + | expireDate | 2042-03-25T23:59:59+0100 | + When user "Alice" updates the space "share space" with settings: + | shareWith | sales | + | shareType | 8 | + | expireDate | 2044-01-01T23:59:59.999+01:00 | + | role | | + Then the HTTP status code should be "200" + And the user "Brian" should have a space called "share space" granted to group "sales" with role "" and expiration date "2044-01-01" + Examples: + | role | + | manager | + | editor | + | viewer | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 1d02a4217..ab77c6dda 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -69,7 +69,7 @@ class SpacesContext implements Context { * @var ChecksumContext */ private ChecksumContext $checksumContext; - + /** * @var FilesVersionsContext */ @@ -1906,9 +1906,10 @@ class SpacesContext implements Context { $space = $this->getSpaceByName($user, $spaceName); $availableRoleToAssignToShareSpace = ['manager', 'editor', 'viewer']; $rows = $table->getRowsHash(); - if (!\in_array(\strtolower($rows['role']), $availableRoleToAssignToShareSpace)) { + if (isset($rows['role']) && !\in_array(\strtolower($rows['role']), $availableRoleToAssignToShareSpace)) { throw new Error("The Selected " . $rows['role'] . " Cannot be Found"); } + $rows["role"] = \array_key_exists("role", $rows) ? $rows["role"] : "viewer"; $rows["shareType"] = \array_key_exists("shareType", $rows) ? $rows["shareType"] : 7; $rows["expireDate"] = \array_key_exists("expireDate", $rows) ? $rows["expireDate"] : null;