From 24e5c0debd3131967df7f9705ee1e4af271706a7 Mon Sep 17 00:00:00 2001 From: giancarlo Date: Sat, 13 Apr 2024 13:49:40 +0800 Subject: [PATCH] Refine warning messages and test feedback This commit refines the warning text in the 'deleteAccountDescription' in locales and associated Supabase service role warning. Additionally, the E2E test for account deletion has been updated to include a response check for a redirection status, improving the reliability of the test outcome. --- apps/e2e/tests/account/account.spec.ts | 8 +++++++- apps/web/public/locales/en/account.json | 2 +- packages/supabase/src/get-service-role-key.ts | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/e2e/tests/account/account.spec.ts b/apps/e2e/tests/account/account.spec.ts index f8362a4c4..742d369ac 100644 --- a/apps/e2e/tests/account/account.spec.ts +++ b/apps/e2e/tests/account/account.spec.ts @@ -56,6 +56,12 @@ test.describe('Account Deletion', () => { await account.setup(); await account.deleteAccount(); - await page.waitForURL('http://localhost:3000'); + const response = await page.waitForResponse((resp) => { + return resp.url().includes('home/settings') && + resp.request().method() === 'POST'; + }); + + // The server should respond with a 303 redirect + expect(response.status()).toBe(303); }); }); \ No newline at end of file diff --git a/apps/web/public/locales/en/account.json b/apps/web/public/locales/en/account.json index 07631d74f..74ef254fc 100644 --- a/apps/web/public/locales/en/account.json +++ b/apps/web/public/locales/en/account.json @@ -132,7 +132,7 @@ "dangerZoneDescription": "Some actions cannot be undone. Please be careful.", "deleteAccount": "Delete your Account", "deletingAccount": "Deleting account. Please wait...", - "deleteAccountDescription": "This will delete your account and the organizations you own. Furthermore, we will immediately cancel any active subscriptions. This action cannot be undone. You will be asked to confirm this action in the next step.", + "deleteAccountDescription": "This will delete your account and the organizations you own. Furthermore, we will immediately cancel any active subscriptions. This action cannot be undone.", "deleteProfileConfirmationInputLabel": "Type DELETE to confirm", "deleteAccountErrorHeading": "Sorry, we couldn't delete your account", "needsReauthentication": "Reauthentication Required", diff --git a/packages/supabase/src/get-service-role-key.ts b/packages/supabase/src/get-service-role-key.ts index 6f2df658b..b1133b99b 100644 --- a/packages/supabase/src/get-service-role-key.ts +++ b/packages/supabase/src/get-service-role-key.ts @@ -10,7 +10,7 @@ export function getServiceRoleKey() { if (process.env.NODE_ENV !== 'production') { console.warn( - `[Dev Only] You are using the Supabase Service Role. Make sure it's the right call.`, + `[Dev Only] This is a simple warning to let you know you are using the Supabase Service Role. Make sure it's the right call.`, ); }