Skip to content

Commit 5810030

Browse files
authored
Merge pull request #11485 from owncloud/test/activities-restoring-file
[tests-only] [full-ci] Add test for checking activities after restoring file
2 parents 5b909f9 + a56938f commit 5810030

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,5 +393,9 @@ The expected failures in this file are from features in the owncloud/ocis repo.
393393

394394
- [apiSharingNgDriveLinkShare/createInternalLinkShare.feature:339](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgDriveLinkShare/createInternalLinkShare.feature#L339)
395395

396+
#### [Activities. no event for restoring file](https://github.com/owncloud/ocis/issues/10010)
397+
398+
- [apiActivities/activities.feature:3552](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/activities.feature#L3552)
399+
396400
Note: always have an empty line at the end of this file.
397401
The bash script that processes this file requires that the last line has a newline on the end.

tests/acceptance/features/apiActivities/activities.feature

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3547,3 +3547,106 @@ Feature: check activities
35473547
}
35483548
}
35493549
"""
3550+
3551+
@issue-10010
3552+
Scenario: check activities after restoring a deleted file
3553+
Given user "Alice" has uploaded file with content "hello world" to "textfile0.txt"
3554+
And user "Alice" has deleted file "textfile0.txt"
3555+
And user "Alice" has restored the file with original path "/textfile0.txt"
3556+
When user "Alice" lists the activities of file "textfile0.txt" from space "Personal" using the Graph API
3557+
Then the HTTP status code should be "200"
3558+
And the JSON data of the response should match
3559+
"""
3560+
{
3561+
"type": "object",
3562+
"required": ["value"],
3563+
"properties": {
3564+
"value": {
3565+
"type": "array",
3566+
"minItems": 3,
3567+
"maxItems": 3,
3568+
"uniqueItems": true,
3569+
"items": {
3570+
"oneOf": [
3571+
{
3572+
"type": "object",
3573+
"required": ["id","template","times"],
3574+
"properties": {
3575+
"template": {
3576+
"type": "object",
3577+
"required": ["message","variables"],
3578+
"properties": {
3579+
"message": { "const": "{user} added {resource} to {folder}" }
3580+
}
3581+
}
3582+
}
3583+
},
3584+
{
3585+
"type": "object",
3586+
"required": ["id","template"],
3587+
"properties": {
3588+
"template": {
3589+
"type": "object",
3590+
"required": ["message","variables"],
3591+
"properties": {
3592+
"message": { "const": "{user} deleted {resource} from {folder}" }
3593+
}
3594+
}
3595+
}
3596+
},
3597+
{
3598+
"type": "object",
3599+
"required": ["id","template","times"],
3600+
"properties": {
3601+
"id": { "pattern": "^%user_id_pattern%$" },
3602+
"template": {
3603+
"type": "object",
3604+
"required": ["message","variables"],
3605+
"properties": {
3606+
"message": { "const": "{user} restored {resource} to {folder}" },
3607+
"variables": {
3608+
"type": "object",
3609+
"required": ["folder", "resource", "user"],
3610+
"properties": {
3611+
"folder": {
3612+
"type": "object",
3613+
"required": ["name"],
3614+
"properties": {
3615+
"name": { "const": "Alice Hansen" }
3616+
}
3617+
},
3618+
"resource": {
3619+
"type": "object",
3620+
"required": ["id","name"],
3621+
"properties": {
3622+
"id": { "const": ""},
3623+
"name": { "const": "textfile0.txt" }
3624+
}
3625+
},
3626+
"user": {
3627+
"type": "object",
3628+
"required": ["id","displayName"],
3629+
"properties": {
3630+
"id": { "pattern": "%user_id_pattern%" },
3631+
"displayName": { "const": "Alice Hansen" }
3632+
}
3633+
}
3634+
}
3635+
}
3636+
}
3637+
},
3638+
"times": {
3639+
"type": "object",
3640+
"required": ["recordedTime"],
3641+
"properties": {
3642+
"recordedTime": { "format": "date-time" }
3643+
}
3644+
}
3645+
}
3646+
}
3647+
]
3648+
}
3649+
}
3650+
}
3651+
}
3652+
"""

0 commit comments

Comments
 (0)