From 2b3925fea8a67c6adbbfd47b1481c8be4e2a639c Mon Sep 17 00:00:00 2001 From: prashant-gurung899 Date: Fri, 24 Jan 2025 12:27:03 +0545 Subject: [PATCH] refactor scenario to disable mail notification for Share removed event Signed-off-by: prashant-gurung899 --- .../apiSettings/notificationSetting.feature | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/tests/acceptance/features/apiSettings/notificationSetting.feature b/tests/acceptance/features/apiSettings/notificationSetting.feature index 60073b909d1..b9dcb82c328 100644 --- a/tests/acceptance/features/apiSettings/notificationSetting.feature +++ b/tests/acceptance/features/apiSettings/notificationSetting.feature @@ -155,7 +155,7 @@ Feature: Notification Settings And the notifications should be empty - Scenario: disable in-app notification for Share Removed event + Scenario: disable mail and in-app notification for Share Removed event Given user "Alice" has sent the following resource share invitation: | resource | lorem.txt | | space | Personal | @@ -163,7 +163,7 @@ Feature: Notification Settings | shareType | user | | permissionsRole | Viewer | When user "Brian" disables notification for the following events using the settings API: - | Share Removed | in-app | + | Share Removed | mail, in-app | Then the HTTP status code should be "201" And the JSON data of the response should match """ @@ -205,11 +205,19 @@ Feature: Notification Settings "properties": { "values":{ "type": "array", - "maxItems": 1, - "minItems": 1, + "maxItems": 2, + "minItems": 2, "uniqueItems": true, "items": { "oneOf": [ + { + "type": "object", + "required": ["key","boolValue"], + "properties": { + "key":{ "const": "mail" }, + "boolValue":{ "const": false } + } + }, { "type": "object", "required": ["key","boolValue"], @@ -231,6 +239,7 @@ Feature: Notification Settings } """ And user "Alice" has removed the access of user "Brian" from resource "lorem.txt" of space "Personal" + And user "Brian" should have "1" emails When user "Brian" lists all notifications Then the HTTP status code should be "200" And user "Brian" should get a notification with subject "Resource shared" and message: @@ -239,7 +248,7 @@ Feature: Notification Settings But user "Brian" should not have a notification related to resource "lorem.txt" with subject "Resource unshared" - Scenario: disable in-app notification for Share Removed event (Project space) + Scenario: disable mail and in-app notification for Share Removed event (Project space) Given using spaces DAV path And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API And user "Alice" has created a space "newSpace" with the default quota using the Graph API @@ -251,7 +260,7 @@ Feature: Notification Settings | shareType | user | | permissionsRole | Viewer | When user "Brian" disables notification for the following events using the settings API: - | Share Removed | in-app | + | Share Removed | mail, in-app | Then the HTTP status code should be "201" And the JSON data of the response should match """ @@ -293,11 +302,19 @@ Feature: Notification Settings "properties": { "values":{ "type": "array", - "maxItems": 1, - "minItems": 1, + "maxItems": 2, + "minItems": 2, "uniqueItems": true, "items": { "oneOf": [ + { + "type": "object", + "required": ["key","boolValue"], + "properties": { + "key":{ "const": "mail" }, + "boolValue":{ "const": false } + } + }, { "type": "object", "required": ["key","boolValue"], @@ -319,6 +336,7 @@ Feature: Notification Settings } """ And user "Alice" has removed the access of user "Brian" from resource "insideSpace.txt" of space "newSpace" + And user "Brian" should have "1" emails When user "Brian" lists all notifications Then the HTTP status code should be "200" And user "Brian" should get a notification with subject "Resource shared" and message: