diff --git a/tests/acceptance/features/apiSharingNg/shareInvitations.feature b/tests/acceptance/features/apiSharingNg/shareInvitations.feature index c4a5fb3d8..057f8ffb3 100644 --- a/tests/acceptance/features/apiSharingNg/shareInvitations.feature +++ b/tests/acceptance/features/apiSharingNg/shareInvitations.feature @@ -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 | | + 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 | | + 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 | | + 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 |