[full-ci] [tests-only] Add test for disable sync with non-existing resource (#8992)

* Added tests for disabling share sync of non-existent resource

* Added tests for disabling share sync with empty resource id

* Added tests for disabling share sync with not shared resource id

* Changed status code as expected

* Added issue tag
This commit is contained in:
Prarup Gurung
2024-05-28 15:36:09 +05:45
committed by GitHub
parent 37304eea27
commit f7a59998a6
2 changed files with 137 additions and 0 deletions
@@ -1188,6 +1188,30 @@ class SharingNgContext implements Context {
$this->featureContext->setResponse($response);
}
/**
* @When user :user tries to disable share sync of a resource :resource using the Graph API
*
* @param string $user
* @param string $resource
*
* @return void
* @throws Exception|GuzzleException
*/
public function userTriesToDisableShareSyncOfResourceUsingTheGraphApi(string $user, string $resource):void {
$shareSpaceId = FeatureContext::SHARES_SPACE_ID;
$shareID = ($resource === 'nonexistent') ? WebDavHelper::generateUUIDv4() : $resource;
$itemId = $shareSpaceId . '!' . $shareID;
$response = GraphHelper::disableShareSync(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$this->featureContext->getActualUsername($user),
$this->featureContext->getPasswordForUser($user),
$itemId,
$shareSpaceId
);
$this->featureContext->setResponse($response);
}
/**
* @Then /^user "([^"]*)" should have sync (enabled|disabled) for share "([^"]*)"$/
*