diff --git a/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature b/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature index 4e162a22e55..97f4c7d1fba 100644 --- a/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature +++ b/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature @@ -2814,3 +2814,622 @@ Feature: listing sharedWithMe when auto-sync is disabled } } """ + + + Scenario: user lists the files with same name shared by user from two project-spaces with him/her + Given user "Carol" has been created with default attributes and without skeleton files + And using spaces DAV path + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And the administrator has assigned the role "Space Admin" to user "Carol" using the Graph API + And user "Alice" has created a space "projectSpace1" with the default quota using the Graph API + And user "Carol" has created a space "projectSpace2" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "projectSpace1" with content "to share" to "textfile.txt" + And user "Alice" has sent the following share invitation: + | resource | textfile.txt | + | space | projectSpace1 | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + And user "Carol" has uploaded a file inside space "projectSpace2" with content "to share" to "textfile.txt" + And user "Carol" has sent the following share invitation: + | resource | textfile.txt | + | space | projectSpace2 | + | 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": 2, + "maxItems": 2, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "eTag", + "file", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "remoteItem", + "size" + ], + "properties": { + "@UI.Hidden": { + "const": false + }, + "@client.synchronize": { + "const": false + }, + "name": { + "const": "textfile.txt" + }, + "parentReference": { + "type": "object", + "required": [ + "driveId", + "driveType", + "id" + ], + "properties": { + "driveId": { + "type": "string", + "pattern": "^%space_id_pattern%$" + }, + "driveType": { + "const": "virtual" + }, + "id": { + "type": "string", + "pattern": "^%file_id_pattern%$" + } + } + }, + "remoteItem": { + "type": "object", + "required": [ + "eTag", + "file", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "permissions" + ], + "properties": { + "name": { + "const": "textfile.txt" + }, + "parentReference": { + "type": "object", + "required": [ + "driveId", + "driveType" + ], + "properties": { + "driveId": { + "type": "string", + "pattern": "^%file_id_pattern%$" + }, + "driveType": { + "type": "string", + "enum": [ + "project" + ] + } + } + }, + "permissions": { + "minItems": 1, + "maxItems": 1, + "type": "array", + "items": { + "type": "object", + "required": [ + "grantedToV2", + "id", + "invitation", + "roles" + ], + "properties": { + "grantedToV2": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "user": { + "type": "object", + "required": [ + "displayName", + "id" + ], + "properties": { + "displayName": { + "const": "Brian Murphy" + } + } + } + } + }, + "invitation": { + "type": "object", + "required": ["invitedBy"], + "properties": { + "invitedBy": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "user": { + "type": "object", + "required": [ + "displayName", + "id" + ], + "properties": { + "displayName": { + "const": "Carol King" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "eTag", + "file", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "remoteItem" + ], + "properties": { + "@UI.Hidden": { + "const": false + }, + "@client.synchronize": { + "const": false + }, + "name": { + "const": "textfile.txt" + }, + "parentReference": { + "type": "object", + "required": [ + "driveId", + "driveType", + "id" + ], + "properties": { + "driveId": { + "type": "string", + "pattern": "^%space_id_pattern%$" + }, + "driveType": { + "const": "virtual" + }, + "id": { + "type": "string", + "pattern": "^%file_id_pattern%$" + } + } + }, + "remoteItem": { + "type": "object", + "required": [ + "eTag", + "file", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "permissions" + ], + "properties": { + "name": { + "const": "textfile.txt" + }, + "parentReference": { + "type": "object", + "required": [ + "driveId", + "driveType" + ], + "properties": { + "driveId": { + "type": "string", + "pattern": "^%file_id_pattern%$" + }, + "driveType": { + "const": "project" + } + } + }, + "permissions": { + "minItems": 1, + "maxItems": 1, + "type": "array", + "items": { + "type": "object", + "required": [ + "grantedToV2", + "id", + "invitation", + "roles" + ], + "properties": { + "grantedToV2": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "user": { + "type": "object", + "required": [ + "displayName", + "id" + ], + "properties": { + "displayName": { + "const": "Brian Murphy" + } + } + } + } + }, + "invitation": { + "type": "object", + "required": [ + "invitedBy" + ], + "properties": { + "invitedBy": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "user": { + "type": "object", + "required": [ + "displayName", + "id" + ], + "properties": { + "displayName": { + "const": "Alice Hansen" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + ] + } + } + } + } + """ + + + Scenario: user lists the folder with same name shared by user from two project-spaces with him/her + Given user "Carol" has been created with default attributes and without skeleton files + And using spaces DAV path + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And the administrator has assigned the role "Space Admin" to user "Carol" using the Graph API + And user "Alice" has created a space "projectSpace1" with the default quota using the Graph API + And user "Carol" has created a space "projectSpace2" with the default quota using the Graph API + And user "Alice" has created a folder "folderToShare" in space "projectSpace1" + And user "Alice" has sent the following share invitation: + | resource | folderToShare | + | space | projectSpace1 | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + And user "Carol" has created a folder "folderToShare" in space "projectSpace2" + And user "Carol" has sent the following share invitation: + | resource | folderToShare | + | space | projectSpace2 | + | 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", + "maxItems": 2, + "minItems": 2, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "eTag", + "folder", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "remoteItem" + ], + "properties": { + "@UI.Hidden": { + "const": false + }, + "@client.synchronize": { + "const": false + }, + "name": { + "const": "folderToShare" + }, + "parentReference": { + "type": "object", + "required": [ + "driveId", + "driveType", + "id" + ], + "properties": { + "driveId": { + "type": "string", + "pattern": "^%space_id_pattern%$" + }, + "driveType": { + "const": "virtual" + }, + "id": { + "type": "string", + "pattern": "^%file_id_pattern%$" + } + } + }, + "remoteItem": { + "type": "object", + "required": [ + "eTag", + "folder", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "permissions" + ], + "properties": { + "name": { + "const": "folderToShare" + }, + "parentReference": { + "type": "object", + "required": [ + "driveId", + "driveType" + ], + "properties": { + "driveId": { + "type": "string", + "pattern": "^%file_id_pattern%$" + }, + "driveType": { + "const": "project" + } + } + }, + "permissions": { + "minItems": 1, + "maxItems": 1, + "type": "array", + "items": + { + "type": "object", + "required": [ + "grantedToV2", + "id", + "invitation", + "roles" + ], + "properties": { + "grantedToV2": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "const": "Brian Murphy" + } + } + } + } + }, + "invitation": { + "type": "object", + "required": ["invitedBy"], + "properties": { + "invitedBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "const": "Alice Hansen" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "eTag", + "folder", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "remoteItem" + ], + "properties": { + "@UI.Hidden": { + "const": false + }, + "@client.synchronize": { + "const": false + }, + "name": { + "const": "folderToShare" + }, + "parentReference": { + "type": "object", + "required": [ + "driveId", + "driveType", + "id" + ], + "properties": { + "driveId": { + "type": "string", + "pattern": "^%space_id_pattern%$" + }, + "driveType": { + "const": "virtual" + }, + "id": { + "type": "string", + "pattern": "^%file_id_pattern%$" + } + } + }, + "remoteItem": { + "type": "object", + "required": [ + "eTag", + "folder", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "permissions" + ], + "properties": { + "name": { + "const": "folderToShare" + }, + "permissions": { + "minItems": 1, + "maxItems": 1, + "type": "array", + "items": + { + "type": "object", + "required": ["grantedToV2", "id", "invitation", "roles"], + "properties": { + "grantedToV2": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "const": "Brian Murphy" + } + } + } + } + }, + "invitation": { + "type": "object", + "required": ["invitedBy"], + "properties": { + "invitedBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "const": "Carol King" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + ] + } + } + } + } + """