add list activites tests for shared resource

This commit is contained in:
amrita authored and amrita-shrestha committed 2025-04-10 09:43:49 +05:45
1 parent 674291eb7c
commit 7deef3a8b5
2 files changed
+127 -1

No files matched your search

+5 -1
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(),
@@ -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 |