Skip to content

Commit

Permalink
add test to disable in-app notification for File rejected event
Browse files Browse the repository at this point in the history
Signed-off-by: prashant-gurung899 <[email protected]>
  • Loading branch information
prashant-gurung899 committed Jan 22, 2025
1 parent f041b6a commit e29e5ef
Showing 1 changed file with 114 additions and 0 deletions.
114 changes: 114 additions & 0 deletions tests/acceptance/features/apiSettings/notificationSetting.feature
Original file line number Diff line number Diff line change
Expand Up @@ -444,3 +444,117 @@ Feature: Notification Settings
| message |
| Alice Hansen shared insideSpace.txt with you |
But user "Brian" should not have a notification related to resource "insideSpace.txt" with subject "Resource unshared"

@antivirus @skipOnReva
Scenario Outline: disable in-app notification for File rejected event
Given using <dav-path-version> DAV path
When user "Brian" disables notification for the following events using the settings API:
| File rejected | in-app |
Then the HTTP status code should be "201"
And the JSON data of the response should match
"""
{
"type": "object",
"required": ["value"],
"properties": {
"value": {
"type": "object",
"required": ["identifier","value"],
"properties": {
"identifier":{
"type": "object",
"required": ["extension","bundle","setting"],
"properties": {
"extension":{
"const": "ocis-accounts"
},
"bundle":{
"const": "profile"
},
"setting":{
"const": "event-postprocessing-step-finished-options"
}
}
},
"value":{
"type": "object",
"required": [
"id",
"bundleId",
"settingId",
"accountUuid",
"resource",
"collectionValue"
],
"properties":{
"id":{
"pattern":"%user_id_pattern%"
},
"bundleId":{
"pattern":"%user_id_pattern%"
},
"settingId":{
"pattern":"%user_id_pattern%"
},
"accountUuid":{
"pattern":"%user_id_pattern%"
},
"resource":{
"type": "object",
"required":["type"],
"properties": {
"type":{
"const": "TYPE_USER"
}
}
},
"collectionValue":{
"type": "object",
"required":["values"],
"properties": {
"values":{
"type": "array",
"maxItems": 1,
"minItems": 1,
"uniqueItems": true,
"items": {
"oneOf": [
{
"type": "object",
"required": [
"key",
"boolValue"
],
"properties": {
"key":{
"const": "in-app"
},
"boolValue":{
"const": false
}
}
}
]
}
}
}
}
}
}
}
}
}
}
"""
And user "Brian" has uploaded file "filesForUpload/filesWithVirus/<file-name>" to "<new-file-name>"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And user "Brian" should not have any notification
Examples:
| dav-path-version | file-name | new-file-name |
| old | eicar.com | virusFile1.txt |
| old | eicar_com.zip | virusFile2.zip |
| new | eicar.com | virusFile1.txt |
| new | eicar_com.zip | virusFile2.zip |
| spaces | eicar.com | virusFile1.txt |
| spaces | eicar_com.zip | virusFile2.zip |

0 comments on commit e29e5ef

Please sign in to comment.