Added tests for enabling share sync with not shared resource id (#8991)

This commit is contained in:
Prarup Gurung
2024-04-29 12:58:31 +05:45
committed by GitHub
parent 3a553aebcb
commit 7bb178bb1f
2 changed files with 41 additions and 1 deletions

View File

@@ -373,3 +373,43 @@ Feature: enable or disable sync of incoming shares
}
}
"""
Scenario: try to enable share sync with not shared resource id
Given user "Brian" has disabled the auto-sync share
And user "Alice" has uploaded file with content "some data" to "/fileNotShared.txt"
And we save it into "FILEID"
When user "Brian" tries to enable share sync of a resource "<<FILEID>>" 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"
}
}
}
}
}
"""

View File

@@ -751,7 +751,7 @@ class SharingNgContext implements Context {
*/
public function userTriesToEnableShareSyncOfResourceUsingTheGraphApi(string $user, string $resource):void {
$shareSpaceId = FeatureContext::SHARES_SPACE_ID;
$itemId = ($resource === 'nonexistent') ? WebDavHelper::generateUUIDv4() : '';
$itemId = ($resource === 'nonexistent') ? WebDavHelper::generateUUIDv4() : $resource;
$response = GraphHelper::enableShareSync(
$this->featureContext->getBaseUrl(),