Skip to content

Commit af3d5d4

Browse files
authored
feat(billing): Update on-demand warning copy (#97522)
Closes: https://linear.app/getsentry/issue/BIL-1195/add-a-label-explaining-that-logs-must-used-the-shared-budget Updated warning copy in the on-demand budget edit form to clarify that both Logs and Seer require a shared on-demand budget for additional usage. <img width="649" height="200" alt="Screenshot 2025-08-08 at 3 35 52 PM" src="https://github.com/user-attachments/assets/8bc1e2db-4e60-4d34-b5c8-5e5a82dff108" />
1 parent 56948e2 commit af3d5d4

File tree

2 files changed

+87
-5
lines changed

2 files changed

+87
-5
lines changed

static/gsApp/views/onDemandBudgets/onDemandBudgetEdit.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,17 @@ class OnDemandBudgetEdit extends Component<Props> {
172172
organization={organization}
173173
subscription={subscription}
174174
/>
175-
{organization.features.includes('seer-billing') && (
175+
{(organization.features.includes('seer-billing') ||
176+
organization.features.includes('logs-billing')) && (
176177
<Alert.Container>
177178
<Alert type="warning">
178-
{t(
179-
"Additional Seer usage is only available through a shared on-demand budget. To ensure you'll have access to additional Seer usage, set up a shared on-demand budget instead."
180-
)}
179+
{organization.features.includes('logs-billing')
180+
? t(
181+
'Logs and additional Seer usage require a shared on-demand budget. Individual budgets cannot be used for these products.'
182+
)
183+
: t(
184+
"Additional Seer usage is only available through a shared on-demand budget. To ensure you'll have access to additional Seer usage, set up a shared on-demand budget instead."
185+
)}
181186
</Alert>
182187
</Alert.Container>
183188
)}

static/gsApp/views/onDemandBudgets/onDemandBudgets.spec.tsx

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ describe('OnDemandBudgets', () => {
589589
).toBeInTheDocument();
590590
});
591591

592-
it('always displays Seer warning alert in per-category section', () => {
592+
it('displays original Seer warning copy by default in per-category section', () => {
593593
organization.features = ['seer-billing'];
594594
const subscription = SubscriptionFixture({
595595
plan: 'am1_business',
@@ -647,4 +647,81 @@ describe('OnDemandBudgets', () => {
647647
)
648648
).toBeInTheDocument();
649649
});
650+
651+
it('displays per-category warning for multiple categories', () => {
652+
// Test with logs-billing only
653+
organization.features = ['logs-billing'];
654+
const subscription = SubscriptionFixture({
655+
plan: 'am2_business',
656+
planTier: PlanTier.AM2,
657+
isFree: false,
658+
isTrial: false,
659+
supportsOnDemand: true,
660+
planDetails: {
661+
...PlanDetailsLookupFixture('am2_business')!,
662+
},
663+
organization,
664+
onDemandBudgets: {
665+
enabled: true,
666+
budgetMode: OnDemandBudgetMode.PER_CATEGORY,
667+
budgets: {
668+
errors: 1000,
669+
transactions: 2000,
670+
attachments: 3000,
671+
monitorSeats: 4000,
672+
},
673+
usedSpends: {},
674+
},
675+
});
676+
677+
const activePlan = subscription.planDetails;
678+
679+
const onDemandBudget = {
680+
budgetMode: OnDemandBudgetMode.PER_CATEGORY as const,
681+
budgets: {
682+
errors: 1000,
683+
transactions: 2000,
684+
attachments: 3000,
685+
monitorSeats: 4000,
686+
},
687+
};
688+
689+
const {rerender} = render(
690+
<OnDemandBudgetEdit
691+
{...defaultProps}
692+
subscription={subscription}
693+
activePlan={activePlan}
694+
onDemandBudget={onDemandBudget}
695+
/>
696+
);
697+
698+
expect(screen.getByTestId('per-category-budget-radio')).toBeInTheDocument();
699+
expect(screen.getByTestId('per-category-budget-radio')).toBeChecked();
700+
701+
// When logs-billing is enabled, should show the logs warning
702+
expect(
703+
screen.getByText(
704+
'Logs and additional Seer usage require a shared on-demand budget. Individual budgets cannot be used for these products.'
705+
)
706+
).toBeInTheDocument();
707+
708+
// Test with both seer-billing and logs-billing
709+
organization.features = ['seer-billing', 'logs-billing'];
710+
711+
rerender(
712+
<OnDemandBudgetEdit
713+
{...defaultProps}
714+
subscription={subscription}
715+
activePlan={activePlan}
716+
onDemandBudget={onDemandBudget}
717+
/>
718+
);
719+
720+
// When both features are enabled
721+
expect(
722+
screen.getByText(
723+
'Logs and additional Seer usage require a shared on-demand budget. Individual budgets cannot be used for these products.'
724+
)
725+
).toBeInTheDocument();
726+
});
650727
});

0 commit comments

Comments
 (0)