unhide share

This commit is contained in:
Viktor Scharf
2024-07-29 11:43:05 +02:00
parent 3bdf6183b9
commit eac8fb8649
3 changed files with 137 additions and 4 deletions
@@ -1036,16 +1036,17 @@ class SharingNgContext implements Context {
/**
* @param string $sharee
* @param string $shareID
* @param bool $hide
*
* @return ResponseInterface
* @throws GuzzleException
* @throws JsonException
*/
public function hideSharedResource(string $sharee, string $shareID): ResponseInterface {
public function hideSharedResource(string $sharee, string $shareID, bool $hide = true): ResponseInterface {
$shareSpaceId = FeatureContext::SHARES_SPACE_ID;
$itemId = $shareSpaceId . '!' . $shareID;
$body['@UI.Hidden'] = true;
return GraphHelper::hideShare(
$body['@UI.Hidden'] = $hide;
return GraphHelper::hideOrUnhideShare(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$this->featureContext->getActualUsername($sharee),
@@ -1166,6 +1167,21 @@ class SharingNgContext implements Context {
$this->featureContext->theHTTPStatusCodeShouldBe(200, '', $response);
}
/**
* @When user :user unhides the shared resource :sharedResource using the Graph API
*
* @param string $user
*
* @return void
* @throws Exception
* @throws GuzzleException
*/
public function userUnhidesTheSharedResourceUsingTheGraphApi(string $user):void {
$shareItemId = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
$response = $this->hideSharedResource($user, $shareItemId, false);
$this->featureContext->setResponse($response);
}
/**
* @When user :user enables sync of share :share offered by :offeredBy from :space space using the Graph API
*