From db70ab27ac30c9c10d16bdb43ab2b0cdf05282ac Mon Sep 17 00:00:00 2001 From: nirajacharya2 <122071597+nirajacharya2@users.noreply.github.com> Date: Mon, 10 Jul 2023 13:07:53 +0545 Subject: [PATCH] added test for mail notification if space admin delete access to space (#6719) --- .../apiNotification/emailNotification.feature | 20 +++++++++++++++++++ .../bootstrap/NotificationContext.php | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/features/apiNotification/emailNotification.feature b/tests/acceptance/features/apiNotification/emailNotification.feature index e74c8de52..ba6d752a6 100644 --- a/tests/acceptance/features/apiNotification/emailNotification.feature +++ b/tests/acceptance/features/apiNotification/emailNotification.feature @@ -157,3 +157,23 @@ Feature: Email notification Zum Ansehen hier klicken: %base_url%/f/%space_id% """ + + + Scenario: user gets an email notification when space admin unshares a space + 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 GraphApi + And user "Alice" has shared a space "new-space" with settings: + | shareWith | Brian | + | role | editor | + When user "Alice" unshares a space "new-space" to user "Brian" + Then the HTTP status code should be "200" + And user "Brian" should have received the following email from user "Alice" about the share of project space "new-space" + """ + Hello Brian Murphy, + + %displayname% has removed you from "new-space". + + You might still have access through your other groups or direct membership. + + Click here to check it: %base_url%/f/%space_id% + """ diff --git a/tests/acceptance/features/bootstrap/NotificationContext.php b/tests/acceptance/features/bootstrap/NotificationContext.php index 235371448..d5c10602f 100644 --- a/tests/acceptance/features/bootstrap/NotificationContext.php +++ b/tests/acceptance/features/bootstrap/NotificationContext.php @@ -239,8 +239,8 @@ class NotificationContext implements Context { [ "code" => "%space_id%", "function" => - [$this->spacesContext, "getSpaceIdByNameFromResponse"], - "parameter" => [$spaceName] + [$this->spacesContext, "getSpaceIdByName"], + "parameter" => [$sender, $spaceName] ], ], null,