Skip to content

Commit

Permalink
adding test for deleating sharer and listing sharedwithme by the sharee
Browse files Browse the repository at this point in the history
  • Loading branch information
nirajacharya2 committed Mar 1, 2024
1 parent fb1d933 commit 59d71cc
Showing 1 changed file with 268 additions and 3 deletions.
271 changes: 268 additions & 3 deletions tests/acceptance/features/apiSharingNg/sharedWithMe.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3670,7 +3670,7 @@ Feature: an user gets the resources shared to them
"properties": {
"driveId": {
"type": "string",
"pattern": "%space_id_pattern%"
"pattern": "^%file_id_pattern%$"
},
"driveType" : {
"const": "project"
Expand Down Expand Up @@ -3885,7 +3885,7 @@ Feature: an user gets the resources shared to them
"properties": {
"driveId": {
"type": "string",
"pattern": "%space_id_pattern%"
"pattern": "^%file_id_pattern%$"
},
"driveType" : {
"const": "project"
Expand Down Expand Up @@ -4095,7 +4095,7 @@ Feature: an user gets the resources shared to them
"properties": {
"driveId": {
"type": "string",
"pattern": "%space_id_pattern%"
"pattern": "^%file_id_pattern%$"
},
"driveType" : {
"const": "project"
Expand Down Expand Up @@ -4426,4 +4426,269 @@ Feature: an user gets the resources shared to them
}
}
}
"""


Scenario: user lists the folder shared with them from personal space after the sharer is deleted
Given user "Alice" has created folder "folder"
And user "Alice" has sent the following share invitation:
| resource | folder |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And the user "Admin" has deleted a user "Alice"
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": 0,
"maxItems": 0
}
}
}
"""

@env-config @8314
Scenario: user lists the file shared with them from project space after the sharer is deleted
Given the config "GRAPH_SPACES_USERS_CACHE_TTL" has been set to "1"
And using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "new-space" with content "some content" to "testfile.txt"
And user "Alice" has sent the following share invitation:
| resource | testfile.txt |
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And the user "Admin" has deleted a user "Alice"
When user "Brian" lists the shares shared with him after clearing user cache 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": 1,
"minItems": 1,
"items": {
"type": "object",
"required": [
"@UI.Hidden",
"@client.synchronize",
"eTag",
"file",
"id",
"lastModifiedDateTime",
"name",
"parentReference",
"remoteItem",
"size"
],
"properties": {
"@UI.Hidden":{
"const": false
},
"@client.synchronize":{
"const": true
},
"eTag": {
"type": "string",
"pattern": "%etag_pattern%"
},
"file": {
"type": "object",
"required": ["mimeType"],
"properties": {
"mimeType": {
"type": "string",
"pattern": "^text/plain"
}
}
},
"id": {
"type": "string",
"pattern": "^%share_id_pattern%$"
},
"name": {
"const": "testfile.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",
"size"
],
"properties": {
"eTag": {
"type": "string",
"pattern": "%etag_pattern%"
},
"file": {
"type": "object",
"required": ["mimeType"],
"properties": {
"mimeType": {
"type": "string",
"pattern": "^text/plain"
}
}
},
"id": {
"type": "string",
"pattern": "^%file_id_pattern%$"
},
"name": {
"const": "testfile.txt"
},
"parentReference": {
"type": "object",
"required": [
"driveId",
"driveType"
],
"properties": {
"driveId": {
"type": "string",
"pattern": "^%file_id_pattern%$"
},
"driveType" : {
"const": "project"
}
}
},
"permissions": {
"type": "array",
"maxItems": 1,
"minItems": 1,
"items": {
"type": "object",
"required": [
"grantedToV2",
"id",
"invitation"
],
"properties": {
"id": {
"type": "string",
"pattern": "^%permissions_id_pattern%$"
},
"grantedToV2": {
"type": "object",
"required": ["user"],
"properties": {
"user": {
"type": "object",
"properties": {
"displayName": {
"const": "Brian Murphy"
},
"id": {
"type": "string",
"pattern":"^%user_id_pattern%$"
}
},
"required": [
"displayName",
"id"
]
}
}
},
"invitation": {
"type": "object",
"properties": {
"invitedBy": {
"type": "object",
"properties": {
"user": {
"type": "object",
"properties": {
"displayName": {
"const": ""
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
}
},
"required": [
"displayName",
"id"
]
}
},
"required": [
"user"
]
}
},
"required": [
"invitedBy"
]
},
"roles": {
"type": "array",
"maxItems": 1,
"minItems": 1,
"items": {
"type": "string",
"pattern": "^%role_id_pattern%$"
}
}
}
}
},
"size": {
"const": 12
}
}
},
"size": {
"const": 12
}
}
}
}
}
}
"""

0 comments on commit 59d71cc

Please sign in to comment.