From f9143d322ed1199001a3f695deb0ed115c761896 Mon Sep 17 00:00:00 2001
From: Maz Ameli <maz@metabase.com>
Date: Fri, 24 Sep 2021 09:40:36 -0700
Subject: [PATCH] Grammar and microcopy tweaks to Unsubscribe modal (#18040)

* grammar and microcopy tweaks

* update cypress test

* fix another test

* update test again
---
 .../UnsubscribeUserForm/UnsubscribeUserForm.jsx           | 8 ++++----
 .../UnsubscribeUserForm/UnsubscribeUserForm.unit.spec.js  | 4 ++--
 .../metabase/scenarios/admin/people/people.cy.spec.js     | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/enterprise/frontend/src/metabase-enterprise/audit_app/components/UnsubscribeUserForm/UnsubscribeUserForm.jsx b/enterprise/frontend/src/metabase-enterprise/audit_app/components/UnsubscribeUserForm/UnsubscribeUserForm.jsx
index d065108fdb8..dd7c5cde438 100644
--- a/enterprise/frontend/src/metabase-enterprise/audit_app/components/UnsubscribeUserForm/UnsubscribeUserForm.jsx
+++ b/enterprise/frontend/src/metabase-enterprise/audit_app/components/UnsubscribeUserForm/UnsubscribeUserForm.jsx
@@ -26,7 +26,7 @@ const UnsubscribeUserForm = ({ user, onUnsubscribe, onClose }) => {
 
   return (
     <ModalContent
-      title={t`Unsubscribe from all subscriptions / alerts`}
+      title={t`Unsubscribe ${user.common_name} from all subscriptions and alerts?`}
       footer={[
         error ? <FormMessage key="message" formError={error} /> : null,
         <Button key="cancel" onClick={onClose}>{t`Cancel`}</Button>,
@@ -34,15 +34,15 @@ const UnsubscribeUserForm = ({ user, onUnsubscribe, onClose }) => {
           key="submit"
           danger
           onClick={handleConfirmClick}
-        >{t`Confirm`}</Button>,
+        >{t`Unsubscribe`}</Button>,
       ]}
       onClose={onClose}
     >
       <ModalMessage>
-        {t`This will delete any dashboard subscriptions or alerts that ${user.common_name} has created and remove them as a recipient from other people’s subscriptions or alerts.`}
+        {t`This will delete any dashboard subscriptions or alerts ${user.common_name} has created, and remove them as a recipient from any other subscriptions or alerts.`}
       </ModalMessage>
       <ModalMessage>
-        {t`This does not effect email distribution lists that are managed outside of Metabase.`}
+        {t`This does not affect email distribution lists that are managed outside of Metabase.`}
       </ModalMessage>
     </ModalContent>
   );
diff --git a/enterprise/frontend/src/metabase-enterprise/audit_app/components/UnsubscribeUserForm/UnsubscribeUserForm.unit.spec.js b/enterprise/frontend/src/metabase-enterprise/audit_app/components/UnsubscribeUserForm/UnsubscribeUserForm.unit.spec.js
index 9ed0c2bfe8d..1844a95fe40 100644
--- a/enterprise/frontend/src/metabase-enterprise/audit_app/components/UnsubscribeUserForm/UnsubscribeUserForm.unit.spec.js
+++ b/enterprise/frontend/src/metabase-enterprise/audit_app/components/UnsubscribeUserForm/UnsubscribeUserForm.unit.spec.js
@@ -21,7 +21,7 @@ describe("UnsubscribeUserForm", () => {
       />,
     );
 
-    screen.getByText("Confirm").click();
+    screen.getByText("Unsubscribe").click();
 
     waitFor(() => {
       expect(onUnsubscribe).toHaveBeenCalled();
@@ -43,7 +43,7 @@ describe("UnsubscribeUserForm", () => {
       />,
     );
 
-    screen.getByText("Confirm").click();
+    screen.getByText("Unsubscribe").click();
 
     waitFor(() => {
       expect(onUnsubscribe).toHaveBeenCalled();
diff --git a/frontend/test/metabase/scenarios/admin/people/people.cy.spec.js b/frontend/test/metabase/scenarios/admin/people/people.cy.spec.js
index d7e1f5011b7..478fd530ab9 100644
--- a/frontend/test/metabase/scenarios/admin/people/people.cy.spec.js
+++ b/frontend/test/metabase/scenarios/admin/people/people.cy.spec.js
@@ -313,9 +313,9 @@ describeWithToken("scenarios > admin > people", () => {
     });
 
     modal().within(() => {
-      cy.findByText(fullName, { exact: false });
-      cy.findByText("Confirm").click();
-      cy.findByText("Confirm").should("not.exist");
+      cy.findAllByText(fullName, { exact: false });
+      cy.findByText("Unsubscribe").click();
+      cy.findByText("Unsubscribe").should("not.exist");
     });
 
     cy.visit("/account/notifications");
-- 
GitLab