Skip to content

Commit 9be6fe7

Browse files
Merge pull request #10997 from owncloud/test/ocm-share-removed-notifications
[tests-only][full-ci] add test to disable in-app notification for share removed event by federated user
2 parents 83cb2c6 + d62a142 commit 9be6fe7

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

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-11042
125+
Scenario: no in-app notification should pop-up for unshared resource when "Share Removed" event is disabled
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)