fix(frontend): redirect pricing links to public page (#5035)

This commit is contained in:
Steven Enamakel
2026-07-18 08:06:20 +03:00
committed by GitHub
parent 022498a014
commit d13a559b90
5 changed files with 12 additions and 6 deletions
@@ -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', () => {
@@ -49,7 +49,7 @@ describe('<BillingPanel />', () => {
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 () => {
@@ -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'
);
});
});
+2 -2
View File
@@ -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,
},
+1 -1
View File
@@ -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';