added test to share project space to a group (#8328)

This commit is contained in:
Prajwol Amatya
2024-01-31 18:06:16 +05:45
committed by GitHub
parent 08ab734119
commit 907a2d9c58

View File

@@ -1759,3 +1759,191 @@ Feature: Send a sharing invitations
| Space Editor |
| Co Owner |
| Manager |
Scenario Outline: send share invitation for project space to group with different roles
Given using spaces DAV path
And user "Carol" has been created with default attributes and without skeleton files
And group "grp1" has been created
And the following users have been added to the following groups
| username | groupname |
| Brian | grp1 |
| Carol | grp1 |
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "NewSpace" with the default quota using the Graph API
When user "Alice" sends the following share invitation for space using the Graph API:
| space | NewSpace |
| sharee | grp1 |
| shareType | group |
| permissionsRole | <permissions-role> |
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",
"items": {
"type": "object",
"required": [
"grantedToV2",
"roles"
],
"properties": {
"grantedToV2": {
"type": "object",
"required": [
"group"
],
"properties": {
"user": {
"type": "object",
"required": [
"displayName",
"id"
],
"properties": {
"displayName": {
"type": "string",
"enum": [
"grp1"
]
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
}
}
}
}
},
"roles": {
"type": "array",
"items": {
"type": "string",
"pattern": "^%role_id_pattern%$"
}
}
}
}
}
}
}
"""
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Co Owner |
| Manager |
Scenario Outline: send share invitation for disabled project space to group with different roles
Given using spaces DAV path
And user "Carol" has been created with default attributes and without skeleton files
And group "grp1" has been created
And the following users have been added to the following groups
| username | groupname |
| Brian | grp1 |
| Carol | grp1 |
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "NewSpace" with the default quota using the Graph API
And user "Admin" has disabled a space "NewSpace"
When user "Alice" sends the following share invitation for space using the Graph API:
| space | NewSpace |
| sharee | grp1 |
| shareType | group |
| permissionsRole | <permissions-role> |
Then the HTTP status code should be "404"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"enum": ["itemNotFound"]
},
"message": {
"type": "string",
"pattern": "^stat: error: not found: %user_id_pattern%$"
}
}
}
}
}
"""
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Co Owner |
| Manager |
Scenario Outline: send share invitation for deleted project space to group with different roles
Given using spaces DAV path
And user "Carol" has been created with default attributes and without skeleton files
And group "grp1" has been created
And the following users have been added to the following groups
| username | groupname |
| Brian | grp1 |
| Carol | grp1 |
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "NewSpace" with the default quota using the Graph API
And user "Admin" has disabled a space "NewSpace"
And user "Admin" has deleted a space "NewSpace"
When user "Alice" sends the following share invitation for space using the Graph API:
| space | NewSpace |
| sharee | grp1 |
| shareType | group |
| permissionsRole | <permissions-role> |
Then the HTTP status code should be "404"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"enum": ["itemNotFound"]
},
"message": {
"type": "string",
"enum": ["stat: error: not found: "]
}
}
}
}
}
"""
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Co Owner |
| Manager |