check thumbnails in the share with me response (#1605)

* check thumbnails in the share with me response

* check preview in report response
This commit is contained in:
Viktor Scharf
2025-10-07 07:43:46 +02:00
committed by GitHub
parent 38b1a0feb0
commit 2fba3c5cdd
4 changed files with 153 additions and 2 deletions

View File

@@ -2030,7 +2030,7 @@ class GraphHelper {
string $user,
string $password
): ResponseInterface {
$url = self::getBetaFullUrl($baseUrl, "me/drive/sharedWithMe");
$url = self::getBetaFullUrl($baseUrl, "me/drive/sharedWithMe?\$expand=thumbnails");
return HttpRequestHelper::get(
$url,
$xRequestId,
@@ -2055,7 +2055,7 @@ class GraphHelper {
string $user,
string $password
): ResponseInterface {
$url = self::getBetaFullUrl($baseUrl, "me/drive/sharedByMe");
$url = self::getBetaFullUrl($baseUrl, "me/drive/sharedByMe?\$expand=thumbnails");
return HttpRequestHelper::get(
$url,
$xRequestId,

View File

@@ -46,6 +46,7 @@ Feature: REPORT request to Shares space
Scenario Outline: check the REPORT response of the found file
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "Not all those who wander are lost." to "/folderMain/SubFolder1/subFOLDER2/frodo.txt"
And user "Alice" has uploaded file "filesForUpload/testavatar.jpg" to "/folderMain/SubFolder1/subFOLDER2/testavatar.jpg"
When user "Brian" searches for "frodo.txt" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
@@ -61,6 +62,21 @@ Feature: REPORT request to Shares space
| oc:privatelink | %base_url%/f/[0-9a-z-$%]+ |
| d:getcontentlength | 34 |
| oc:remote-item-id | %file_id_pattern% |
When user "Brian" searches for "testavatar.jpg" using the WebDAV API
Then the HTTP status code should be "207"
And the following headers should match these regular expressions
| X-Request-Id | %request_id_pattern% |
And as user "Brian" the REPORT response should contain a resource "testavatar.jpg" with these key and value pairs:
| key | value |
| oc:fileid | %file_id_pattern% |
| oc:file-parent | %file_id_pattern% |
| oc:shareroot | /folderMain |
| oc:name | testavatar.jpg |
| d:getcontenttype | image/jpeg |
| oc:permissions | S |
| oc:privatelink | %base_url%/f/[0-9a-z-$%]+ |
| oc:has-preview | 1 |
| oc:remote-item-id | %file_id_pattern% |
Examples:
| dav-path-version |
| old |

View File

@@ -139,6 +139,68 @@ Feature: resources shared by user
| Viewer |
Scenario: sharer gets thumbnails when listing shared image file (Personal space)
Given user "Alice" has uploaded file "filesForUpload/testavatar.jpg" to "testavatar.jpg"
And user "Alice" has sent the following resource share invitation:
| resource | testavatar.jpg |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Alice" lists the shares shared by her using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should contain resource "testavatar.jpg" with the following data:
"""
{
"type": "object",
"required": [ "thumbnails" ],
"properties": {
"thumbnails": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": ["small", "medium", "large"],
"properties": {
"small": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=36.*y=36"
}
}
},
"medium": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=48.*y=48"
}
}
},
"large": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=96.*y=96"
}
}
}
}
}
}
}
}
"""
Scenario: sharer lists the file share shared from inside a folder (Personal space)
Given user "Alice" has created folder "FolderToShare"
And user "Alice" has uploaded file with content "hello world" to "FolderToShare/textfile.txt"

View File

@@ -315,6 +315,79 @@ Feature: an user gets the resources shared to them
| Viewer |
Scenario: sharee gets thumbnails when listing shared image file (Personal space)
Given user "Alice" has uploaded file "filesForUpload/testavatar.jpg" to "testavatar.jpg"
And user "Alice" has sent the following resource share invitation:
| resource | testavatar.jpg |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" lists the shares shared with him 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": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": ["thumbnails"],
"properties": {
"thumbnails": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": ["small", "medium", "large"],
"properties": {
"small": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=36.*y=36"
}
}
},
"medium": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=48.*y=48"
}
}
},
"large": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=96.*y=96"
}
}
}
}
}
}
}
}
}
}
}
"""
Scenario Outline: sharee lists the folder share (Personal space)
Given user "Alice" has created folder "folder"
And user "Alice" has sent the following resource share invitation: