diff --git a/tests/acceptance/features/apiGraph/activities.feature b/tests/acceptance/features/apiGraph/activities.feature index 4b337151207..47fa029afa5 100644 --- a/tests/acceptance/features/apiGraph/activities.feature +++ b/tests/acceptance/features/apiGraph/activities.feature @@ -879,3 +879,186 @@ Feature: check activities } } """ + + + Scenario: check link creation and deletion activity for a file + Given user "Alice" has uploaded file with content "ownCloud test text file 0" to "textfile0.txt" + And user "Alice" has created the following resource link share: + | resource | textfile0.txt | + | space | Personal | + | permissionsRole | view | + | password | %public% | + And user "Alice" removes the link of file "textfile0.txt" from space "Personal" using the Graph API + When user "Alice" lists the activities for file "textfile0.txt" of space "Personal" 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": 3, + "maxItems": 3, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "object", + "required": ["id","template","times"], + "properties": { + "template": { + "type": "object", + "required": ["message","variables"], + "properties": { + "message": { + "const": "{user} added {resource} to {space}" + }, + "variables": { + "type": "object", + "required": ["resource", "space", "user"], + "properties": { + "resource": { + "type": "object", + "required": ["id", "name"], + "properties": { + "name": { + "const": "textfile0.txt" + } + } + } + } + } + } + } + } + }, + { + "type": "object", + "required": ["id","template","times"], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "template": { + "type": "object", + "required": ["message","variables"], + "properties": { + "message": { + "const": "{user} shared {resource} via link" + }, + "variables": { + "type": "object", + "required": ["resource","user"], + "properties": { + "resource": { + "type": "object", + "required": ["id","name"], + "properties": { + "id": { + "type": "string", + "pattern": "%file_id_pattern%" + }, + "name": { + "const": "textfile0.txt" + } + } + }, + "user": { + "type": "object", + "required": ["id","displayName"], + "properties": { + "id": { + "type": "string", + "pattern": "%user_id_pattern%" + }, + "displayName": { + "const": "Alice" + } + } + } + } + } + } + }, + "times": { + "type": "object", + "required": ["recordedTime"], + "properties": { + "recordedTime": { + "type": "string", + "format": "date-time" + } + } + } + } + }, + { + "type": "object", + "required": ["id","template","times"], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "template": { + "type": "object", + "required": ["message","variables"], + "properties": { + "message": { + "const": "{user} removed link to {resource}" + }, + "variables": { + "type": "object", + "required": ["resource","user"], + "properties": { + "resource": { + "type": "object", + "required": ["id","name"], + "properties": { + "id": { + "type": "string", + "pattern": "%file_id_pattern%" + }, + "name": { + "const": "textfile0.txt" + } + } + }, + "user": { + "type": "object", + "required": ["id","displayName"], + "properties": { + "id": { + "type": "string", + "pattern": "%user_id_pattern%" + }, + "displayName": { + "const": "Alice" + } + } + } + } + } + } + }, + "times": { + "type": "object", + "required": ["recordedTime"], + "properties": { + "recordedTime": { + "type": "string", + "format": "date-time" + } + } + } + } + } + ] + } + } + } + } + """