mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-07-29 16:58:43 -04:00
api-test: fix removeAccessToDrive.feature:145 (#3179)
* api-test: fix removeAccessToDrive.feature:145 * fix after review
This commit is contained in:
@@ -1030,6 +1030,21 @@ class SharingNgContext implements Context {
|
||||
if ($shareType == 'user' && !isset($recipient)) {
|
||||
$this->featureContext->shareNgAddToCreatedUserGroupShares($this->getDrivePermissionsList($sharer, $space));
|
||||
$permissionID = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
|
||||
} elseif ($shareType == 'group' && !isset($recipient)) {
|
||||
// https://github.com/opencloud-eu/opencloud/pull/3179#issuecomment-5103212045
|
||||
$retried = 0;
|
||||
do {
|
||||
$response = $this->getDrivePermissionsList($sharer, $space);
|
||||
$tryAgain = $response->getStatusCode() === 404
|
||||
&& $retried < HttpRequestHelper::numRetriesOnHttpTooEarly();
|
||||
if ($tryAgain) {
|
||||
$retried += 1;
|
||||
echo "Drive permissions of space '$space' not available for user '$sharer' yet, retrying ($retried)...\n";
|
||||
// wait 500ms and try again
|
||||
\usleep(500 * 1000);
|
||||
}
|
||||
} while ($tryAgain);
|
||||
$permissionID = $this->featureContext->getJsonDecodedResponse($response)['value'][0]['id'];
|
||||
} else {
|
||||
$permissionID = match ($shareType) {
|
||||
'link' => $this->featureContext->shareNgGetLastCreatedLinkShareID(),
|
||||
@@ -1206,6 +1221,25 @@ class SharingNgContext implements Context {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $space
|
||||
*
|
||||
* @return void
|
||||
* @throws JsonException
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
#[When('user :user tries to remove own group access from space :space using root endpoint of the Graph API')]
|
||||
public function userRemovesOwnAccessOfGroupFromSpaceUsingGraphAPI(
|
||||
string $user,
|
||||
string $space
|
||||
): void {
|
||||
$this->featureContext->setResponse(
|
||||
$this->removeAccessToSpace($user, 'group', $space)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $user
|
||||
|
||||
@@ -339,10 +339,6 @@ _ocdav: api compatibility, return correct status code_
|
||||
- [coreApiWebdavPreviews/previews.feature:265](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavPreviews/previews.feature#L265)
|
||||
|
||||
|
||||
#### [500 when user tries to delete group from space](https://github.com/opencloud-eu/opencloud/issues/2799)
|
||||
|
||||
- [apiSharingNg1/removeAccessToDrive.feature:145](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSharingNg1/removeAccessToDrive.feature#L145)
|
||||
|
||||
#### [POSIX: failing CLI commands](https://github.com/opencloud-eu/opencloud/issues/3095)
|
||||
|
||||
- [cliCommands/restoreTrashBinItems.feature:11](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/cliCommands/restoreTrashBinItems.feature#L11)
|
||||
|
||||
@@ -342,10 +342,6 @@ _ocdav: api compatibility, return correct status code_
|
||||
- [coreApiWebdavPreviews/previews.feature:264](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavPreviews/previews.feature#L264)
|
||||
- [coreApiWebdavPreviews/previews.feature:265](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavPreviews/previews.feature#L265)
|
||||
|
||||
### TODO: adjust test
|
||||
|
||||
- [apiSharingNg1/removeAccessToDrive.feature:145](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSharingNg1/removeAccessToDrive.feature#L145)
|
||||
|
||||
tests/acceptance/features/cliCommands/restoreTrashBinItems.feature
|
||||
|
||||
#### [POSIX: failing CLI commands](https://github.com/opencloud-eu/opencloud/issues/3095)
|
||||
|
||||
@@ -153,7 +153,7 @@ Feature: Remove access to a drive
|
||||
| shareType | group |
|
||||
| permissionsRole | Manager |
|
||||
And user "Alice" has removed own access from space "NewSpace"
|
||||
When user "Brian" tries to remove the access of group "group1" from space "NewSpace" using root endpoint of the Graph API
|
||||
When user "Brian" tries to remove own group access from space "NewSpace" using root endpoint of the Graph API
|
||||
Then the HTTP status code should be "403"
|
||||
And the user "Brian" should have a space called "NewSpace"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user