Skip to content

Commit 2d30ed8

Browse files
test: add test to disable email notification for share removed event by federated user
Signed-off-by: prashant-gurung899 <[email protected]>
1 parent d19378c commit 2d30ed8

File tree

2 files changed

+103
-3
lines changed

2 files changed

+103
-3
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -332,5 +332,8 @@ The expected failures in this file are from features in the owncloud/ocis repo.
332332
- [apiOcm/share.feature:1154](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1154)
333333
- [apiOcm/share.feature:1174](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L1174)
334334

335+
#### [[OCM] no notification for federated share removed event](https://github.com/owncloud/ocis/issues/11042)
336+
- [apiOcm/ocmNotifications.feature:109](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/ocmNotifications.feature#L109)
337+
335338
Note: always have an empty line at the end of this file.
336339
The bash script that processes this file requires that the last line has a newline on the end.

tests/acceptance/features/apiOcm/ocmNotifications.feature

+100-3
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
10-
And user "Alice" has uploaded file with content "ocm test" to "textfile.txt"
119
And "Alice" has created the federation share invitation
10+
And user "Alice" has uploaded file with content "ocm test" to "textfile.txt"
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,98 @@ 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+
@issue-10718 @issue-11042
107+
Scenario: federated user disables mail and in-app notification for "Share Removed" event
108+
Given using server "LOCAL"
109+
And user "Alice" has sent the following resource share invitation to federated user:
110+
| resource | textfile.txt |
111+
| space | Personal |
112+
| sharee | Brian |
113+
| shareType | user |
114+
| permissionsRole | Viewer |
115+
And using server "REMOTE"
116+
When user "Brian" disables notification for the following events using the settings API:
117+
| Share Removed | mail, in-app |
118+
Then the HTTP status code should be "201"
119+
And the JSON data of the response should match
120+
"""
121+
{
122+
"type": "object",
123+
"required": ["value"],
124+
"properties": {
125+
"value": {
126+
"type": "object",
127+
"required": ["identifier","value"],
128+
"properties": {
129+
"identifier":{
130+
"type": "object",
131+
"required": ["extension","bundle","setting"],
132+
"properties": {
133+
"extension":{ "const": "ocis-accounts" },
134+
"bundle":{ "const": "profile" },
135+
"setting":{ "const": "event-share-removed-options" }
136+
}
137+
},
138+
"value":{
139+
"type": "object",
140+
"required": ["id","bundleId","settingId","accountUuid","resource","collectionValue"],
141+
"properties":{
142+
"id":{ "pattern":"%uuidv4_pattern%" },
143+
"bundleId":{ "pattern":"%uuidv4_pattern%" },
144+
"settingId":{ "pattern":"%uuidv4_pattern%" },
145+
"accountUuid":{ "pattern":"%uuidv4_pattern%" },
146+
"resource":{
147+
"type": "object",
148+
"required":["type"],
149+
"properties": {
150+
"type":{ "const": "TYPE_USER" }
151+
}
152+
},
153+
"collectionValue":{
154+
"type": "object",
155+
"required":["values"],
156+
"properties": {
157+
"values":{
158+
"type": "array",
159+
"maxItems": 2,
160+
"minItems": 2,
161+
"uniqueItems": true,
162+
"items": {
163+
"oneOf": [
164+
{
165+
"type": "object",
166+
"required": ["key","boolValue"],
167+
"properties": {
168+
"key":{ "const": "mail" },
169+
"boolValue":{ "const": false }
170+
}
171+
},
172+
{
173+
"type": "object",
174+
"required": ["key","boolValue"],
175+
"properties": {
176+
"key":{ "const": "in-app" },
177+
"boolValue":{ "const": false }
178+
}
179+
}
180+
]
181+
}
182+
}
183+
}
184+
}
185+
}
186+
}
187+
}
188+
}
189+
}
190+
}
191+
"""
192+
And using server "LOCAL"
193+
And user "Alice" has removed the access of user "Brian" from resource "textfile.txt" of space "Personal"
194+
And using server "REMOTE"
195+
And user "Brian" should have "1" emails
196+
And user "Brian" should get a notification with subject "Resource shared" and message:
197+
| message |
198+
| Alice Hansen shared textfile.txt with you |
199+
And user "Brian" should not have a notification related to resource "textfile.txt" with subject "Resource unshared"

0 commit comments

Comments
 (0)