Skip to content

Commit

Permalink
enable auto-sync step
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Apr 23, 2024
1 parent 87a3a44 commit 5e3378e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Feature: enable or disable sync of incoming shares

@issue-8724
Scenario: try to enable share sync of a non-existent resource
Given user "Brian" has enabled the auto-sync share
When user "Brian" tries to enable share sync of a non-existent resource using the Graph API
Then the HTTP status code should be "400"
And the JSON data of the response should match
Expand Down
13 changes: 7 additions & 6 deletions tests/acceptance/features/bootstrap/SettingsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public function theUserHasSwitchedSystemLanguage(string $user, string $language)
* @throws GuzzleException
* @throws Exception
*/
public function sendRequestToDisableAutoAccepting(string $user): ResponseInterface {
public function changeAutoShareSync(string $user, bool $enable): ResponseInterface {
$fullUrl = $this->baseUrl . $this->settingsUrl . "values-save";
$body = json_encode(
[
Expand All @@ -505,7 +505,7 @@ public function sendRequestToDisableAutoAccepting(string $user): ResponseInterfa
"resource" => [
"type" => "TYPE_USER"
],
"boolValue" => false
"boolValue" => $enable
]
],
JSON_THROW_ON_ERROR
Expand All @@ -522,18 +522,19 @@ public function sendRequestToDisableAutoAccepting(string $user): ResponseInterfa
}

/**
* @Given user :user has disabled auto-accepting
* @Given user :user has disabled the auto-sync share
* @Given /^user "([^"]*)" has (disabled|enabled) auto-accepting$/
* @Given /^user "([^"]*)" has (disabled|enabled) the auto-sync share$/
*
* @param string $user
* @param bool $action
*
* @return void
*
* @throws Exception
* @throws GuzzleException
*/
public function theUserHasDisabledAutoAccepting(string $user): void {
$response = $this->sendRequestToDisableAutoAccepting($user);
public function theUserHasDisabledAutoAccepting(string $user, bool $action): void {
$response = $this->changeAutoShareSync($user, $action === "enabled");
$this->featureContext->theHTTPStatusCodeShouldBe(
201,
"Expected response status code should be 201",
Expand Down

0 comments on commit 5e3378e

Please sign in to comment.