From d13a559b904a24f0b5155dae7b9c3c8bda20ecfa Mon Sep 17 00:00:00 2001 From: Steven Enamakel <31011319+senamakel@users.noreply.github.com> Date: Sat, 18 Jul 2026 08:06:20 +0300 Subject: [PATCH] fix(frontend): redirect pricing links to public page (#5035) --- app/src/components/home/__tests__/HomeBanners.test.tsx | 4 ++-- app/src/components/settings/panels/BillingPanel.test.tsx | 2 +- app/src/config/__tests__/navConfig.test.ts | 6 ++++++ app/src/config/navConfig.ts | 4 ++-- app/src/utils/links.ts | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/src/components/home/__tests__/HomeBanners.test.tsx b/app/src/components/home/__tests__/HomeBanners.test.tsx index 151abfab9..d0d4e7d11 100644 --- a/app/src/components/home/__tests__/HomeBanners.test.tsx +++ b/app/src/components/home/__tests__/HomeBanners.test.tsx @@ -30,7 +30,7 @@ describe('HomeBanners', () => { fireEvent.click(screen.getByRole('button', { name: 'Buy top-up credits' })); - expect(openUrl).toHaveBeenCalledWith('https://tinyhumans.ai/dashboard'); + expect(openUrl).toHaveBeenCalledWith('https://tinyhumans.ai/pricing'); }); it('renders danger tone styles for UsageLimitBanner', () => { @@ -53,7 +53,7 @@ describe('HomeBanners', () => { fireEvent.click(screen.getByRole('button', { name: /get a subscription/i })); - expect(openUrl).toHaveBeenCalledWith('https://tinyhumans.ai/dashboard'); + expect(openUrl).toHaveBeenCalledWith('https://tinyhumans.ai/pricing'); }); it('opens the Discord invite through openUrl from the Discord banner', () => { diff --git a/app/src/components/settings/panels/BillingPanel.test.tsx b/app/src/components/settings/panels/BillingPanel.test.tsx index bd7dc1c6c..b4a74e70f 100644 --- a/app/src/components/settings/panels/BillingPanel.test.tsx +++ b/app/src/components/settings/panels/BillingPanel.test.tsx @@ -49,7 +49,7 @@ describe('', () => { fireEvent.click(screen.getByRole('button', { name: 'Open billing dashboard' })); await waitFor(() => expect(openUrlMock).toHaveBeenCalledTimes(1)); - expect(openUrlMock).toHaveBeenLastCalledWith('https://tinyhumans.ai/dashboard'); + expect(openUrlMock).toHaveBeenLastCalledWith('https://tinyhumans.ai/pricing'); }); it('invokes the navigation back handler from both the header and the inline button', async () => { diff --git a/app/src/config/__tests__/navConfig.test.ts b/app/src/config/__tests__/navConfig.test.ts index 72d5a57f2..4550c37fe 100644 --- a/app/src/config/__tests__/navConfig.test.ts +++ b/app/src/config/__tests__/navConfig.test.ts @@ -102,4 +102,10 @@ describe('AVATAR_MENU_ITEMS', () => { const openUrlItems = AVATAR_MENU_ITEMS.filter(i => i.kind === 'openUrl').map(i => i.id); expect(openUrlItems).toEqual(['billing']); }); + + it('opens billing on the public pricing page', () => { + expect(AVATAR_MENU_ITEMS.find(i => i.id === 'billing')?.target).toBe( + 'https://tinyhumans.ai/pricing' + ); + }); }); diff --git a/app/src/config/navConfig.ts b/app/src/config/navConfig.ts index 76d43665e..97a2c4fb7 100644 --- a/app/src/config/navConfig.ts +++ b/app/src/config/navConfig.ts @@ -5,6 +5,7 @@ * This module is pure data — no JSX, no React imports. Icons are owned by * BottomTabBar.tsx and mapped from tab.id. */ +import { BILLING_DASHBOARD_URL } from '../utils/links'; // ── Tab bar ────────────────────────────────────────────────────────────────── @@ -103,8 +104,7 @@ export const AVATAR_MENU_ITEMS: AvatarMenuItem[] = [ { id: 'billing', labelKey: 'nav.avatarMenu.billing', - // Resolved at runtime via BILLING_DASHBOARD_URL; placeholder keeps typing clean. - target: 'https://tinyhumans.ai/dashboard', + target: BILLING_DASHBOARD_URL, kind: 'openUrl', cloudOnly: true, }, diff --git a/app/src/utils/links.ts b/app/src/utils/links.ts index 87e4e85bd..a734ac501 100644 --- a/app/src/utils/links.ts +++ b/app/src/utils/links.ts @@ -1,4 +1,4 @@ export const DISCORD_INVITE_URL = 'https://discord.tinyhumans.ai'; -export const BILLING_DASHBOARD_URL = 'https://tinyhumans.ai/dashboard'; +export const BILLING_DASHBOARD_URL = 'https://tinyhumans.ai/pricing'; export const PRIVACY_POLICY_URL = 'https://tinyhumans.gitbook.io/openhuman/legal/privacy-policy'; export const TERMS_OF_USE_URL = 'https://tinyhumans.gitbook.io/openhuman/legal/terms-of-use';