From c2498503b829b9560d34bf7ddc580dd73b0fa6f6 Mon Sep 17 00:00:00 2001
From: Muhsin <12408980+muhsin-k@users.noreply.github.com>
Date: Wed, 22 Jul 2026 12:01:56 +0400
Subject: [PATCH] fix(whatsapp): prioritize health errors over stale data
---
.../inbox/components/AccountHealth.vue | 2 +-
.../components/specs/AccountHealth.spec.js | 20 +++++++++++++++++--
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AccountHealth.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AccountHealth.vue
index adbf9d0c1..2eddb7f6b 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AccountHealth.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AccountHealth.vue
@@ -412,7 +412,7 @@ const handleCopyWebhookUrl = async url => {
-
+
{{ section.title }}
diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/components/specs/AccountHealth.spec.js b/app/javascript/dashboard/routes/dashboard/settings/inbox/components/specs/AccountHealth.spec.js
index d771318e4..cca7bfbb5 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/inbox/components/specs/AccountHealth.spec.js
+++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/components/specs/AccountHealth.spec.js
@@ -11,9 +11,9 @@ vi.mock('vue-i18n', () => ({
}));
describe('AccountHealth', () => {
- const mountComponent = healthData =>
+ const mountComponent = (healthData, props = {}) =>
shallowMount(AccountHealth, {
- props: { healthData },
+ props: { healthData, ...props },
});
beforeEach(() => {
@@ -66,4 +66,20 @@ describe('AccountHealth', () => {
'INBOX_MGMT.ACCOUNT_HEALTH.VALUES.MODES.CUSTOM_MODE'
);
});
+
+ it('shows the current error instead of stale health data', () => {
+ const wrapper = mountComponent(
+ { verified_name: 'Stale Business Name' },
+ {
+ healthError: {
+ type: 'authorization',
+ message: 'The connection needs to be refreshed',
+ },
+ isEmbeddedSignup: true,
+ }
+ );
+
+ expect(wrapper.text()).toContain('The connection needs to be refreshed');
+ expect(wrapper.text()).not.toContain('Stale Business Name');
+ });
});