From bb8588f9c064ca1793ff4074bd843ed481ea2a00 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Mon, 12 May 2025 16:33:47 +0545 Subject: [PATCH 1/2] add test for disabling mail notifications for space deleted event Signed-off-by: nabim777 --- .../apiSettings/notificationSetting.feature | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/tests/acceptance/features/apiSettings/notificationSetting.feature b/tests/acceptance/features/apiSettings/notificationSetting.feature index 99b61aa3fe4..026754e53a7 100644 --- a/tests/acceptance/features/apiSettings/notificationSetting.feature +++ b/tests/acceptance/features/apiSettings/notificationSetting.feature @@ -1049,3 +1049,82 @@ Feature: Notification Settings | lorem.txt | User Light | | uploadFolder | User | | uploadFolder | User Light | + + @issue-10941 + Scenario: disable in-app notification for "Space Deleted" event + Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "new-space" with the default quota using the Graph API + And user "Alice" has sent the following space share invitation: + | space | new-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | Space Viewer | + And user "Brian" disables notification for the following event using the settings API: + | event | Space Deleted | + | notificationTypes | in-app | + Then the HTTP status code should be "201" + And the JSON data of the response should match + """ + { + "type": "object", + "required": ["value"], + "properties": { + "value": { + "type": "object", + "required": ["identifier", "value"], + "properties": { + "identifier": { + "type": "object", + "required": ["extension", "bundle", "setting"], + "properties": { + "extension": { "const": "ocis-accounts" }, + "bundle": { "const": "profile" }, + "setting": { "const": "event-space-deleted-options" } + } + }, + "value": { + "type": "object", + "required": ["id", "bundleId", "settingId", "accountUuid", "resource", "collectionValue"], + "properties": { + "id": { "pattern": "%user_id_pattern%" }, + "bundleId": { "pattern": "%user_id_pattern%" }, + "settingId": { "pattern": "%user_id_pattern%" }, + "accountUuid": { "pattern": "%user_id_pattern%" }, + "resource": { + "type": "object", + "required": ["type"], + "properties": { + "type": { "const": "TYPE_USER" } + } + }, + "collectionValue": { + "type": "object", + "required": ["values"], + "properties": { + "values": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": ["key", "boolValue"], + "properties": { + "key": { "const": "in-app" }, + "boolValue": { "const": false } + } + } + } + } + } + } + } + } + } + } + } + """ + And user "Alice" has disabled a space "new-space" + And user "Alice" has deleted a space "new-space" + When user "Brian" lists all notifications + Then the HTTP status code should be "200" + And user "Brian" should not have any notification From a8b831aee160439877ca51f605d3292f053930b7 Mon Sep 17 00:00:00 2001 From: Sawjan Gurung Date: Thu, 15 May 2025 10:10:07 +0545 Subject: [PATCH 2/2] test: fix step name Co-authored-by: Prajwol Amatya <83579989+PrajwolAmatya@users.noreply.github.com> --- .../acceptance/features/apiSettings/notificationSetting.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/features/apiSettings/notificationSetting.feature b/tests/acceptance/features/apiSettings/notificationSetting.feature index 026754e53a7..4e047a3aeaf 100644 --- a/tests/acceptance/features/apiSettings/notificationSetting.feature +++ b/tests/acceptance/features/apiSettings/notificationSetting.feature @@ -1059,7 +1059,7 @@ Feature: Notification Settings | sharee | Brian | | shareType | user | | permissionsRole | Space Viewer | - And user "Brian" disables notification for the following event using the settings API: + When user "Brian" disables notification for the following event using the settings API: | event | Space Deleted | | notificationTypes | in-app | Then the HTTP status code should be "201"