Skip to content

Commit 5e97a62

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 eb70b76 commit 5e97a62

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed

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

+3
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

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

0 commit comments

Comments
 (0)