diff --git a/assets/admin/pages/SubscriptionPage.test.tsx b/assets/admin/pages/SubscriptionPage.test.tsx index 1c776021..5e56849d 100644 --- a/assets/admin/pages/SubscriptionPage.test.tsx +++ b/assets/admin/pages/SubscriptionPage.test.tsx @@ -44,12 +44,14 @@ function mockApi({ my = DEFAULT_MY, plans = PLANS }: { my?: any; plans?: any[] } beforeEach(() => { get.mockReset(); mockApi(); }); describe('SubscriptionPage', () => { - it('renders the three plans with the most-popular badge on the basic plan', async () => { + it('renders the three plans with the most-popular badge on the professional plan', async () => { renderWithProviders(, { route: '/admin/subscription' }); expect(await screen.findByText('پلن پایه')).toBeInTheDocument(); expect(screen.getByText('پلن رایگان')).toBeInTheDocument(); expect(screen.getByText('پلن حرفه‌ای')).toBeInTheDocument(); - expect(screen.getByText('محبوب‌ترین')).toBeInTheDocument(); + // most-popular badge sits on the professional (top) card, matching tauri + const proCard = within(screen.getByTestId('plan-card-professional')); + expect(proCard.getByText('محبوب‌ترین')).toBeInTheDocument(); }); it('shows the current-plan card without an expiry warning when the plan is healthy', async () => { diff --git a/assets/admin/pages/SubscriptionPage.tsx b/assets/admin/pages/SubscriptionPage.tsx index 4983d9b0..53ee41e8 100644 --- a/assets/admin/pages/SubscriptionPage.tsx +++ b/assets/admin/pages/SubscriptionPage.tsx @@ -32,8 +32,9 @@ const CARD_FEATURE_LABELS: Record = { insurance: 'مدیریت بیمه', }; -/** The plan highlighted as "most popular" in the UI (no backend flag exists). */ -const POPULAR_PLAN_NAME = 'basic'; +/** The plan highlighted as "most popular" in the UI (no backend flag exists); + * matches clinic-pro-tauri, which flags the professional (top) plan. */ +const POPULAR_PLAN_NAME = 'professional'; const PLAN_META: Record = { free: { label: 'رایگان', desc: 'مناسب برای شروع کار', tint: 'var(--surface-2)' }, @@ -137,9 +138,9 @@ export default function SubscriptionPage() { {/* ── Plan cards ── */} {plansLoading ? ( -
+
{[1, 2, 3].map((i) => ( -
+
))}
) : plans.length === 0 ? ( @@ -147,7 +148,7 @@ export default function SubscriptionPage() { در حال حاضر پلنی برای نمایش وجود ندارد.
) : ( -
+
{plans.map((plan) => (