diff --git a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature index 254ab8a7ebf..cfcf4f080e5 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature @@ -388,3 +388,43 @@ Feature: Share spaces | manager | | editor | | viewer | + + + Scenario Outline: delete 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 | | + | 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 "" + 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 | | + | 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 "" + Examples: + | role | + | manager | + | editor | + | viewer | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index ab77c6ddab1..710bfd36e68 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -3229,8 +3229,7 @@ public function theUserShouldHaveSpaceWithRecipient( foreach ($spaceAsArray['root']['permissions'] as $permission) { if (isset($permission['grantedToIdentities'][0][$recipientType]) && $permission['roles'][0] === $role && $permission['grantedToIdentities'][0][$recipientType]['id'] === $recipientId) { $foundRoleInResponse = true; - if ($expirationDate !== null) { - Assert::assertArrayHasKey('expirationDateTime', $permission, 'expirationDateTime key not found in response'); + if ($expirationDate !== null && isset($permission['expirationDateTime'])) { Assert::assertEquals($expirationDate, (preg_split("/[\sT]+/", $permission['expirationDateTime']))[0], "$expirationDate is different in the response"); } break;