Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci] adding test for enabling sync of non-existent resource #8875

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,40 @@ Feature: enable or disable sync of incoming shares
| resource |
| textfile0.txt |
| FolderToShare |

@issue-8724
Scenario: try to enable share sync of a non-existent resource
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
"""
{
"type": "object",
"required": ["error"],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"innererror",
"message"
],
"properties": {
"code" : {
"const": "invalidRequest"
},
"innererror" : {
"type": "object",
"required": [
"date",
"request-id"
]
},
"message" : {
"const": "mounting share failed"
}
}
}
}
}
"""
20 changes: 20 additions & 0 deletions tests/acceptance/features/bootstrap/SharingNgContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,26 @@ public function userEnablesSyncOfShareUsingTheGraphApi(string $user, string $sha
$this->featureContext->setResponse($response);
}

/**
* @When user :user tries to enable share sync of a non-existent resource using the Graph API
*
* @param string $user
*
* @return void
*/
public function userTriesToEnablsShareSyncOfNonExistentResourceUsingTheGraphApi(string $user):void {
$shareSpaceId = FeatureContext::SHARES_SPACE_ID;
$response = GraphHelper::enableShareSync(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$this->featureContext->getActualUsername($user),
$this->featureContext->getPasswordForUser($user),
WebDavHelper::generateUUIDv4(),
grgprarup marked this conversation as resolved.
Show resolved Hide resolved
$shareSpaceId
);
$this->featureContext->setResponse($response);
}

/**
* @Then /^user "([^"]*)" should have sync (enabled|disabled) for share "([^"]*)"$/
*
Expand Down