From 2b8a14c4d2bae7c6173b2bcb16bec66b9bed900e Mon Sep 17 00:00:00 2001 From: roo hutton Date: Fri, 4 Jul 2025 10:38:48 +0100 Subject: [PATCH] Merge pull request #26822 from overleaf/rh-current-plan-free-personal Treat 'free - personal' plan as free in current plan widget GitOrigin-RevId: 271aca9b1c97389357b7b7d107ed838ebbcada40 --- .../current-plan-widget.tsx | 8 ++++-- .../components/current-plan-widget.test.tsx | 27 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx b/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx index 1d17fe75a3..b07a4e164a 100644 --- a/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx +++ b/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx @@ -14,8 +14,12 @@ function CurrentPlanWidget() { } const { type } = usersBestSubscription - const isFreePlan = type === 'free' || type === 'standalone-ai-add-on' - const isIndividualPlan = type === 'individual' + const isFreePlan = + type === 'free' || + type === 'standalone-ai-add-on' || + (type === 'individual' && usersBestSubscription.plan?.name === 'Free') + const isIndividualPlan = + type === 'individual' && !(usersBestSubscription.plan?.name === 'Free') const isGroupPlan = type === 'group' const isCommonsPlan = type === 'commons' const isPaused = diff --git a/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx b/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx index 84836c204b..00a8593169 100644 --- a/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx +++ b/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx @@ -83,6 +83,33 @@ describe('', function () { }) }) + describe('free plan with Personal plan name', function () { + beforeEach(function () { + window.metaAttributesCache.set('ol-usersBestSubscription', { + type: 'individual', + plan: { + name: 'Free', + }, + subscription: { + planCode: 'personal', + name: 'Free', + }, + featuresPageURL: '/features', + }) + + render() + }) + + it('shows text and tooltip on mouseover', async function () { + const link = screen.getByRole('link', { + name: /you’re on the free plan/i, + }) + fireEvent.mouseOver(link) + + await screen.findByRole('tooltip', { name: freePlanTooltipMessage }) + }) + }) + describe('paid plan', function () { describe('trial', function () { const subscription = {