Skip to content

Commit f755bf3

Browse files
add test to disable email notifications by federated user
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
1 parent 210f337 commit f755bf3

File tree

1 file changed

+58
-2
lines changed

1 file changed

+58
-2
lines changed

tests/acceptance/features/apiOcm/ocmNotifications.feature

+58-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ Feature: ocm notifications
44
I want to manage my notification settings
55
So that I do not get notified of unimportant events
66

7-
8-
Scenario: federated user disables mail and in-app notification for "Share Received" event
7+
Background:
98
Given user "Alice" has been created with default attributes
109
And user "Alice" has uploaded file with content "ocm test" to "textfile.txt"
1110
And "Alice" has created the federation share invitation
1211
And using server "REMOTE"
1312
And user "Brian" has been created with default attributes
1413
And "Brian" has accepted invitation
14+
15+
16+
Scenario: federated user disables mail and in-app notification for "Share Received" event
1517
When user "Brian" disables notification for the following events using the settings API:
1618
| Share Received | mail,in-app |
1719
Then the HTTP status code should be "201"
@@ -100,3 +102,57 @@ Feature: ocm notifications
100102
Then the HTTP status code should be "200"
101103
And the notifications should be empty
102104
And user "Brian" should have "0" emails
105+
106+
107+
Scenario: federated user disables email notification
108+
When user "Brian" disables email notification using the settings API
109+
Then the HTTP status code should be "201"
110+
And the JSON data of the response should match
111+
"""
112+
{
113+
"type": "object",
114+
"required": ["value"],
115+
"properties": {
116+
"value": {
117+
"type": "object",
118+
"required": ["identifier","value"],
119+
"properties": {
120+
"identifier":{
121+
"type": "object",
122+
"required": ["extension","bundle","setting"],
123+
"properties": {
124+
"extension":{ "const": "ocis-accounts" },
125+
"bundle":{ "const": "profile" },
126+
"setting":{ "const": "disable-email-notifications" }
127+
}
128+
},
129+
"value":{
130+
"type": "object",
131+
"required": ["id","bundleId","settingId","accountUuid","resource"],
132+
"properties":{
133+
"id":{ "pattern": "%uuidv4_pattern%" },
134+
"bundleId":{ "pattern":"%uuidv4_pattern%" },
135+
"settingId":{ "pattern":"%uuidv4_pattern%" },
136+
"accountUuid":{ "pattern":"%uuidv4_pattern%" },
137+
"resource":{
138+
"type": "object",
139+
"required":["type"],
140+
"properties": {
141+
"type":{ "const": "TYPE_USER" }
142+
}
143+
}
144+
}
145+
}
146+
}
147+
}
148+
}
149+
}
150+
"""
151+
And using server "LOCAL"
152+
And user "Alice" has sent the following resource share invitation to federated user:
153+
| resource | textfile.txt |
154+
| space | Personal |
155+
| sharee | Brian |
156+
| shareType | user |
157+
| permissionsRole | Viewer |
158+
And user "Brian" should have "0" emails

0 commit comments

Comments
 (0)