Skip to content

Commit c6d8269

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

File tree

1 file changed

+65
-2
lines changed

1 file changed

+65
-2
lines changed

tests/acceptance/features/apiOcm/ocmNotifications.feature

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

7+
Background:
8+
Given user "Alice" has been created with default attributes
9+
And using server "REMOTE"
10+
And user "Brian" has been created with default attributes
11+
712

813
Scenario: federated user disables mail and in-app notification for "Share Received" event
9-
Given user "Alice" has been created with default attributes
14+
Given using server "LOCAL"
1015
And user "Alice" has uploaded file with content "ocm test" to "textfile.txt"
1116
And "Alice" has created the federation share invitation
1217
And using server "REMOTE"
13-
And user "Brian" has been created with default attributes
1418
And "Brian" has accepted invitation
1519
When user "Brian" disables notification for the following events using the settings API:
1620
| Share Received | mail,in-app |
@@ -100,3 +104,62 @@ Feature: ocm notifications
100104
Then the HTTP status code should be "200"
101105
And the notifications should be empty
102106
And user "Brian" should have "0" emails
107+
108+
109+
Scenario: federated user disables email notification
110+
Given using server "LOCAL"
111+
And user "Alice" has uploaded file with content "ocm test" to "textfile.txt"
112+
And "Alice" has created the federation share invitation
113+
And using server "REMOTE"
114+
And "Brian" has accepted invitation
115+
When user "Brian" disables email notification using the settings API
116+
Then the HTTP status code should be "201"
117+
And the JSON data of the response should match
118+
"""
119+
{
120+
"type": "object",
121+
"required": ["value"],
122+
"properties": {
123+
"value": {
124+
"type": "object",
125+
"required": ["identifier","value"],
126+
"properties": {
127+
"identifier":{
128+
"type": "object",
129+
"required": ["extension","bundle","setting"],
130+
"properties": {
131+
"extension":{ "const": "ocis-accounts" },
132+
"bundle":{ "const": "profile" },
133+
"setting":{ "const": "disable-email-notifications" }
134+
}
135+
},
136+
"value":{
137+
"type": "object",
138+
"required": ["id","bundleId","settingId","accountUuid","resource"],
139+
"properties":{
140+
"id":{ "pattern": "%uuidv4_pattern%" },
141+
"bundleId":{ "pattern":"%uuidv4_pattern%" },
142+
"settingId":{ "pattern":"%uuidv4_pattern%" },
143+
"accountUuid":{ "pattern":"%uuidv4_pattern%" },
144+
"resource":{
145+
"type": "object",
146+
"required":["type"],
147+
"properties": {
148+
"type":{ "const": "TYPE_USER" }
149+
}
150+
}
151+
}
152+
}
153+
}
154+
}
155+
}
156+
}
157+
"""
158+
And using server "LOCAL"
159+
And user "Alice" has sent the following resource share invitation to federated user:
160+
| resource | textfile.txt |
161+
| space | Personal |
162+
| sharee | Brian |
163+
| shareType | user |
164+
| permissionsRole | Viewer |
165+
And user "Brian" should have "0" emails

0 commit comments

Comments
 (0)