Skip to content

fix(billing): hide pending changes for the same reserved budgets #93857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions static/gsAdmin/components/customers/pendingChanges.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {OrganizationFixture} from 'sentry-fixture/organization';

import {PlanDetailsLookupFixture} from 'getsentry-test/fixtures/planDetailsLookup';
import {PlanMigrationFixture} from 'getsentry-test/fixtures/planMigration';
import {SeerReservedBudgetFixture} from 'getsentry-test/fixtures/reservedBudget';
import {
Am3DsEnterpriseSubscriptionFixture,
SubscriptionFixture,
Expand Down Expand Up @@ -376,6 +377,39 @@ describe('PendingChanges', function () {
);
});

it('does not render reserved budgets with mocked values', function () {
const subscription = SubscriptionFixture({
organization: OrganizationFixture(),
reservedBudgets: [
SeerReservedBudgetFixture({
id: '0',
reservedBudget: 0,
}),
],
pendingChanges: PendingChangesFixture({
planDetails: PlanDetailsLookupFixture('am3_business_ent'),
plan: 'am3_business_ent',
planName: 'Business',
reserved: {
spans: 0,
spansIndexed: 0,
},
reservedBudgets: [
{
reservedBudget: 0,
categories: {seerAutofix: true, seerScanner: true},
},
],
}),
});

const {container} = render(<PendingChanges subscription={subscription} />);

expect(container).not.toHaveTextContent(
'Reserved budgets — $0.00 for seer budget → $0.00 for seer budget'
);
});

it('renders reserved budgets without existing budgets', function () {
const subscription = SubscriptionFixture({
organization: OrganizationFixture(),
Expand Down
10 changes: 5 additions & 5 deletions static/gsAdmin/components/customers/pendingChanges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ function getRegularChanges(subscription: Subscription) {
});

if (oldBudgetsChanges.length > 0 || newBudgetsChanges.length > 0) {
changes.push(
`Reserved budgets — ${
oldBudgetsChanges.length > 0 ? oldBudgetsChanges.join(', ') : 'None'
} → ${newBudgetsChanges.length > 0 ? newBudgetsChanges.join(', ') : 'None'}`
);
const before = oldBudgetsChanges.length > 0 ? oldBudgetsChanges.join(', ') : 'None';
const after = newBudgetsChanges.length > 0 ? newBudgetsChanges.join(', ') : 'None';
if (before !== after) {
changes.push(`Reserved budgets — ${before} → ${after}`);
}
}

return changes;
Expand Down
Loading