Skip to content

Commit be1d9e3

Browse files
authored
fix(billing): Remove upgrade prompt for Business plan users on trial ended banner (#102466)
Closes https://linear.app/getsentry/issue/BIL-1508/update-product-trial-ended-copy When product trials end, users on paid Business plans were incorrectly seeing "Keep using more by upgrading your plan" which was confusing since they're already on a Business plan. This change updates the trial ended banner to show different messages based on the user's plan: - Business plan users: "Your unlimited [Product] trial ended." (no upgrade prompt) - Team plan users: "Your unlimited [Product] trial ended. Keep using more by upgrading your plan." (shows upgrade prompt) - Free plan users: "Your unlimited [Product] trial ended. Keep using more by upgrading your plan." (shows upgrade prompt) The button behavior remains unchanged (Request Upgrade / Update Plan based on billing role), only the message text is updated for Business plan users. This fix ensures Business plan users see appropriate messaging without confusing upgrade prompts, while Team plan users are still encouraged to upgrade to Business.
1 parent 7884775 commit be1d9e3

File tree

2 files changed

+93
-6
lines changed

2 files changed

+93
-6
lines changed

static/gsApp/components/productTrial/productTrialAlert.spec.tsx

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import ProductTrialAlert from 'getsentry/components/productTrial/productTrialAle
1010
import {getProductForPath} from 'getsentry/components/productTrial/productTrialPaths';
1111
import SubscriptionStore from 'getsentry/stores/subscriptionStore';
1212
import type {ProductTrial} from 'getsentry/types';
13+
import {PlanName} from 'getsentry/types';
1314

1415
describe('ProductTrialAlert', () => {
1516
const api = new MockApiClient();
@@ -133,7 +134,7 @@ describe('ProductTrialAlert', () => {
133134
).toBeInTheDocument();
134135
});
135136

136-
it('loads trial ended', () => {
137+
it('loads trial ended for free plan users', () => {
137138
const trial: ProductTrial = {
138139
category: DataCategory.PROFILES,
139140
isStarted: true,
@@ -159,6 +160,82 @@ describe('ProductTrialAlert', () => {
159160
)
160161
).toBeInTheDocument();
161162
});
163+
164+
it('loads trial ended for Business plan users without upgrade prompt', () => {
165+
const businessSubscription = SubscriptionFixture({
166+
organization,
167+
planDetails: {
168+
...SubscriptionFixture({organization}).planDetails,
169+
price: 99,
170+
name: PlanName.BUSINESS,
171+
},
172+
});
173+
174+
const trial: ProductTrial = {
175+
category: DataCategory.TRANSACTIONS,
176+
isStarted: true,
177+
reasonCode: 2001,
178+
startDate: moment().utc().subtract(16, 'days').format(),
179+
endDate: moment().utc().subtract(2, 'days').format(),
180+
lengthDays: 14,
181+
};
182+
183+
render(
184+
<ProductTrialAlert
185+
api={api}
186+
organization={organization}
187+
subscription={businessSubscription}
188+
trial={trial}
189+
product={DataCategory.TRANSACTIONS}
190+
/>
191+
);
192+
expect(screen.getByText('Performance Monitoring Trial')).toBeInTheDocument();
193+
// For Business plan users, should NOT include "Keep using more by upgrading your plan."
194+
expect(
195+
screen.getByText('Your unlimited Performance Monitoring trial ended.')
196+
).toBeInTheDocument();
197+
// Should NOT show the upgrade prompt text
198+
expect(
199+
screen.queryByText(/Keep using more by upgrading your plan/)
200+
).not.toBeInTheDocument();
201+
});
202+
203+
it('loads trial ended for Team plan users with upgrade prompt', () => {
204+
const teamSubscription = SubscriptionFixture({
205+
organization,
206+
planDetails: {
207+
...SubscriptionFixture({organization}).planDetails,
208+
price: 29,
209+
name: PlanName.TEAM,
210+
},
211+
});
212+
213+
const trial: ProductTrial = {
214+
category: DataCategory.REPLAYS,
215+
isStarted: true,
216+
reasonCode: 2001,
217+
startDate: moment().utc().subtract(16, 'days').format(),
218+
endDate: moment().utc().subtract(2, 'days').format(),
219+
lengthDays: 14,
220+
};
221+
222+
render(
223+
<ProductTrialAlert
224+
api={api}
225+
organization={organization}
226+
subscription={teamSubscription}
227+
trial={trial}
228+
product={DataCategory.REPLAYS}
229+
/>
230+
);
231+
expect(screen.getByText('Session Replay Trial')).toBeInTheDocument();
232+
// For Team plan users, SHOULD show the upgrade prompt
233+
expect(
234+
screen.getByText(
235+
'Your unlimited Session Replay trial ended. Keep using more by upgrading your plan.'
236+
)
237+
).toBeInTheDocument();
238+
});
162239
});
163240

164241
describe('getProductForPath', () => {

static/gsApp/components/productTrial/productTrialAlert.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import AddEventsCTA, {type EventType} from 'getsentry/components/addEventsCTA';
2020
import ProductTrialTag from 'getsentry/components/productTrial/productTrialTag';
2121
import StartTrialButton from 'getsentry/components/startTrialButton';
2222
import type {ProductTrial, Subscription} from 'getsentry/types';
23-
import {UsageAction} from 'getsentry/utils/billing';
23+
import {isBizPlanFamily, UsageAction} from 'getsentry/utils/billing';
2424
import {getCategoryInfoFromPlural} from 'getsentry/utils/dataCategory';
2525
import titleCase from 'getsentry/utils/titleCase';
2626
import trackGetsentryAnalytics from 'getsentry/utils/trackGetsentryAnalytics';
@@ -178,10 +178,20 @@ function ProductTrialAlert(props: ProductTrialAlertProps) {
178178
}
179179
} else if (daysLeft < 0 && daysLeft >= -7 && trial.isStarted) {
180180
alertHeader = t('%s Trial', titleCase(getProductName(trial.category)));
181-
alertText = t(
182-
'Your unlimited %s trial ended. Keep using more by upgrading your plan.',
183-
getProductName(product ?? trial.category)
184-
);
181+
182+
if (isPaid && isBizPlanFamily(subscription.planDetails)) {
183+
// For Business plan users, just say the trial ended without upgrade prompt
184+
alertText = t(
185+
'Your unlimited %s trial ended.',
186+
getProductName(product ?? trial.category)
187+
);
188+
} else {
189+
// For free and Team plan users, show the upgrade prompt
190+
alertText = t(
191+
'Your unlimited %s trial ended. Keep using more by upgrading your plan.',
192+
getProductName(product ?? trial.category)
193+
);
194+
}
185195

186196
alertButton =
187197
isPaid && !hasBillingRole ? (

0 commit comments

Comments
 (0)