Skip to content

Commit e09f0a6

Browse files
Merge pull request #10905 from owncloud/test/space-unshared-notifications
[tests-only][full-ci] add test to disable notification for `Removed as space member` event
2 parents 59cb01f + ff7e6f9 commit e09f0a6

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

tests/acceptance/features/apiSettings/notificationSetting.feature

+101
Original file line numberDiff line numberDiff line change
@@ -801,3 +801,104 @@ Feature: Notification Settings
801801
| message |
802802
| Alice Hansen shared lorem.txt with you |
803803
And user "Brian" should have "0" emails
804+
805+
806+
Scenario: disable mail and in-app notification for "Removed as space member" event
807+
Given using spaces DAV path
808+
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
809+
And user "Alice" has created a space "newSpace" with the default quota using the Graph API
810+
And user "Alice" has sent the following space share invitation:
811+
| space | newSpace |
812+
| sharee | Brian |
813+
| shareType | user |
814+
| permissionsRole | Space Viewer |
815+
When user "Brian" disables notification for the following events using the settings API:
816+
| Removed as space member | mail,in-app |
817+
Then the HTTP status code should be "201"
818+
And the JSON data of the response should match
819+
"""
820+
{
821+
"type": "object",
822+
"required": ["value"],
823+
"properties": {
824+
"value": {
825+
"type": "object",
826+
"required": ["identifier","value"],
827+
"properties": {
828+
"identifier":{
829+
"type": "object",
830+
"required": ["extension","bundle","setting"],
831+
"properties": {
832+
"extension":{ "const": "ocis-accounts" },
833+
"bundle":{ "const": "profile" },
834+
"setting":{ "const": "event-space-unshared-options" }
835+
}
836+
},
837+
"value":{
838+
"type": "object",
839+
"required": ["id","bundleId","settingId","accountUuid","resource","collectionValue"],
840+
"properties":{
841+
"id":{ "pattern":"%uuidv4_pattern%" },
842+
"bundleId":{ "pattern":"%uuidv4_pattern%" },
843+
"settingId":{ "pattern":"%uuidv4_pattern%" },
844+
"accountUuid":{ "pattern":"%uuidv4_pattern%" },
845+
"resource":{
846+
"type": "object",
847+
"required":["type"],
848+
"properties": {
849+
"type":{ "const": "TYPE_USER" }
850+
}
851+
},
852+
"collectionValue":{
853+
"type": "object",
854+
"required":["values"],
855+
"properties": {
856+
"values":{
857+
"type": "array",
858+
"maxItems": 2,
859+
"minItems": 2,
860+
"uniqueItems": true,
861+
"items": {
862+
"oneOf": [
863+
{
864+
"type": "object",
865+
"required": ["key","boolValue"],
866+
"properties": {
867+
"key":{ "const": "mail" },
868+
"boolValue":{ "const": false }
869+
}
870+
},
871+
{
872+
"type": "object",
873+
"required": ["key","boolValue"],
874+
"properties": {
875+
"key":{ "const": "in-app" },
876+
"boolValue":{ "const": false }
877+
}
878+
}
879+
]
880+
}
881+
}
882+
}
883+
}
884+
}
885+
}
886+
}
887+
}
888+
}
889+
}
890+
"""
891+
And user "Alice" has removed the access of user "Brian" from space "newSpace"
892+
And user "Brian" should get a notification with subject "Space shared" and message:
893+
| message |
894+
| Alice Hansen added you to Space newSpace |
895+
But user "Brian" should not have a notification related to space "newSpace" with subject "Removed from Space"
896+
And user "Brian" should have "1" emails
897+
And user "Brian" should have received the following email from user "Alice" about the share of project space "newSpace"
898+
"""
899+
Hello Brian Murphy,
900+
901+
%displayname% has invited you to join "newSpace".
902+
903+
Click here to view it: %base_url%/f/%space_id%
904+
"""

0 commit comments

Comments
 (0)