1
0
mirror of https://github.com/owncloud/ocis.git synced 2025-04-18 23:44:07 +03:00

add list activites tests for shared resource

This commit is contained in:
amrita 2025-04-07 16:30:48 +05:45 committed by amrita-shrestha
parent 674291eb7c
commit 7deef3a8b5
No known key found for this signature in database
GPG Key ID: A3040598D5B018ED
2 changed files with 127 additions and 1 deletions

View File

@ -2934,7 +2934,11 @@ class GraphContext implements Context {
string $resource,
string $spaceName
): void {
$resourceId = $this->spacesContext->getResourceId($user, $spaceName, $resource);
if ($spaceName === "Shares") {
$resourceId = $this->spacesContext->getSharesRemoteItemId($user, $resource);
} else {
$resourceId = $this->spacesContext->getResourceId($user, $spaceName, $resource);
}
$response = GraphHelper::getActivities(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),

View File

@ -1482,3 +1482,125 @@ Feature: ListGrants role
| permissions-role |
| Viewer With ListGrants |
| File Editor With ListGrants |
Scenario Outline: list activities of folder shared with listGrant roles (Personal space)
Given the administrator has enabled the permissions role "<permissions-role>"
And using spaces DAV path
And using SharingNG
And user "Alice" has created folder "folder"
And user "Alice" has sent the following resource share invitation:
| resource | folder |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Brian" has a share "folder" synced
When user "Brian" lists the activities of folder "folder" from space "Shares" using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": ["value"],
"properties": {
"value": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"uniqueItems": true,
"items": {
"oneOf": [
{
"type": "object",
"required": ["id","template","times"],
"properties": {
"id": {"pattern": "^%user_id_pattern%$"},
"template": {
"type": "object",
"required": ["message","variables"],
"properties": {
"message": {"const": "{user} added {resource} to {folder}"},
"variables":{
"type": "object",
"required": ["folder","resource","user"],
"properties": {
"folder": {
"type": "object",
"required": ["id","name"],
"properties":{
"id": {"const": ""},
"name": {"const": "shared-with-me"}
}
},
"resource": {
"type": "object",
"required": ["id","name"],
"properties": {"name": {"const": "folder"}}
},
"user": {
"type": "object",
"required": ["id","displayName"],
"properties":{"displayName": {"const": "Alice Hansen"}}
}
}
}
}
}
}
},
{
"type": "object",
"required": ["id","template","times"],
"properties": {
"id": {"pattern": "^%user_id_pattern%$"},
"template": {
"type": "object",
"required": ["message","variables"],
"properties": {
"message": {"const": "{user} shared {resource} with {sharee}"},
"variables": {
"type": "object",
"required": ["folder","resource","sharee","user"],
"properties": {
"resource": {
"type": "object",
"required": ["id","name"],
"properties": {"name": {"const": "folder"}}
},
"sharee": {
"type": "object",
"required": ["id","displayName"],
"properties": {"displayName": {"const": "Brian"}}
},
"user": {
"type": "object",
"required": ["id","displayName"],
"properties": {"displayName": {"const": "Alice Hansen"}}
}
}
}
}
},
"times": {
"type": "object",
"required": ["recordedTime"],
"properties": {
"recordedTime": {
"type": "string",
"format": "date-time"
}
}
}
}
}
]
}
}
}
}
"""
Examples:
| permissions-role |
| Viewer With ListGrants |
| Editor With ListGrants |