Skip to content

Commit afdd2d0

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 29ff1f8 commit afdd2d0

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,5 +348,8 @@ The expected failures in this file are from features in the owncloud/ocis repo.
348348
- [apiAuthApp/token.feature:183](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAuthApp/token.feature#L183)
349349
- [apiAuthApp/token.feature:189](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAuthApp/token.feature#L189)
350350

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

tests/acceptance/features/apiOcm/ocmNotifications.feature

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,98 @@ Feature: ocm notifications
120120
Token: %fed_invitation_token%
121121
ProviderDomain: %local_base_url%
122122
"""
123+
124+
@issue-10718 @issue-11042
125+
Scenario: federated user disables mail and in-app notification for "Share Removed" event
126+
Given using server "LOCAL"
127+
And user "Alice" has sent the following resource share invitation to federated user:
128+
| resource | textfile.txt |
129+
| space | Personal |
130+
| sharee | Brian |
131+
| shareType | user |
132+
| permissionsRole | Viewer |
133+
And using server "REMOTE"
134+
When user "Brian" disables notification for the following event using the settings API:
135+
| Share Removed | mail, in-app |
136+
Then the HTTP status code should be "201"
137+
And the JSON data of the response should match
138+
"""
139+
{
140+
"type": "object",
141+
"required": ["value"],
142+
"properties": {
143+
"value": {
144+
"type": "object",
145+
"required": ["identifier","value"],
146+
"properties": {
147+
"identifier":{
148+
"type": "object",
149+
"required": ["extension","bundle","setting"],
150+
"properties": {
151+
"extension":{ "const": "ocis-accounts" },
152+
"bundle":{ "const": "profile" },
153+
"setting":{ "const": "event-share-removed-options" }
154+
}
155+
},
156+
"value":{
157+
"type": "object",
158+
"required": ["id","bundleId","settingId","accountUuid","resource","collectionValue"],
159+
"properties":{
160+
"id":{ "pattern":"%uuidv4_pattern%" },
161+
"bundleId":{ "pattern":"%uuidv4_pattern%" },
162+
"settingId":{ "pattern":"%uuidv4_pattern%" },
163+
"accountUuid":{ "pattern":"%uuidv4_pattern%" },
164+
"resource":{
165+
"type": "object",
166+
"required":["type"],
167+
"properties": {
168+
"type":{ "const": "TYPE_USER" }
169+
}
170+
},
171+
"collectionValue":{
172+
"type": "object",
173+
"required":["values"],
174+
"properties": {
175+
"values":{
176+
"type": "array",
177+
"maxItems": 2,
178+
"minItems": 2,
179+
"uniqueItems": true,
180+
"items": {
181+
"oneOf": [
182+
{
183+
"type": "object",
184+
"required": ["key","boolValue"],
185+
"properties": {
186+
"key":{ "const": "mail" },
187+
"boolValue":{ "const": false }
188+
}
189+
},
190+
{
191+
"type": "object",
192+
"required": ["key","boolValue"],
193+
"properties": {
194+
"key":{ "const": "in-app" },
195+
"boolValue":{ "const": false }
196+
}
197+
}
198+
]
199+
}
200+
}
201+
}
202+
}
203+
}
204+
}
205+
}
206+
}
207+
}
208+
}
209+
"""
210+
And using server "LOCAL"
211+
And user "Alice" has removed the access of user "Brian" from resource "textfile.txt" of space "Personal"
212+
And using server "REMOTE"
213+
And user "Brian" should have "1" emails
214+
And user "Brian" should get a notification with subject "Resource shared" and message:
215+
| message |
216+
| Alice Hansen shared textfile.txt with you |
217+
And user "Brian" should not have a notification related to resource "textfile.txt" with subject "Resource unshared"

0 commit comments

Comments
 (0)