Skip to content

fix(seer): hide usage cards for developer plans #93074

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 2 commits into from
Jun 9, 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
38 changes: 38 additions & 0 deletions static/gsApp/views/subscriptionPage/overview.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {OrganizationFixture} from 'sentry-fixture/organization';
import {BillingConfigFixture} from 'getsentry-test/fixtures/billingConfig';
import {CustomerUsageFixture} from 'getsentry-test/fixtures/customerUsage';
import {InvoicePreviewFixture} from 'getsentry-test/fixtures/invoicePreview';
import {MetricHistoryFixture} from 'getsentry-test/fixtures/metricHistory';
import {PlanDetailsLookupFixture} from 'getsentry-test/fixtures/planDetailsLookup';
import {PlanMigrationFixture} from 'getsentry-test/fixtures/planMigration';
import {RecurringCreditFixture} from 'getsentry-test/fixtures/recurringCredit';
Expand All @@ -21,6 +22,8 @@ import {
} from 'sentry-test/reactTestingLibrary';
import {textWithMarkupMatcher} from 'sentry-test/utils';

import {DataCategory} from 'sentry/types/core';

import {PendingChangesFixture} from 'getsentry/__fixtures__/pendingChanges';
import SubscriptionStore from 'getsentry/stores/subscriptionStore';
import {CohortId, OnDemandBudgetMode, PlanTier, type Subscription} from 'getsentry/types';
Expand Down Expand Up @@ -215,6 +218,41 @@ describe('Subscription > Overview', () => {
expect(screen.getByText('Issue Scans Included in Subscription')).toBeInTheDocument();
});

it('does not render Seer on developer plan', async function () {
const subscription = SubscriptionFixture({
organization,
plan: 'am3_f',
planTier: PlanTier.AM3,
});

subscription.categories = {
...subscription.categories,
seerAutofix: MetricHistoryFixture({
category: DataCategory.SEER_AUTOFIX,
reserved: 0,
prepaid: 0,
order: 27,
}),
seerScanner: MetricHistoryFixture({
category: DataCategory.SEER_SCANNER,
reserved: 0,
prepaid: 0,
order: 28,
}),
};
SubscriptionStore.set(organization.slug, subscription);

render(<Overview location={mockLocation} />, {organization});

expect(await screen.findByText('Overview')).toBeInTheDocument();
expect(screen.queryByTestId('unsupported-plan')).not.toBeInTheDocument();
expect(screen.getByRole('button', {name: 'Manage subscription'})).toBeInTheDocument();
assertUsageCards(subscription);

expect(screen.queryByTestId('usage-card-seerAutofix')).not.toBeInTheDocument();
expect(screen.queryByTestId('usage-card-seerScanner')).not.toBeInTheDocument();
});

it('renders for am3', async function () {
const subscription = SubscriptionFixture({
plan: 'am3_f',
Expand Down
8 changes: 8 additions & 0 deletions static/gsApp/views/subscriptionPage/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ function Overview({location, subscription, promotionData}: Props) {
)
.map(categoryHistory => {
const category = categoryHistory.category;

// XXX: need to hide these categories for developer plans
if (
category === DataCategory.SEER_AUTOFIX ||
category === DataCategory.SEER_SCANNER
) {
return null;
}
// The usageData does not include details for seat-based categories.
// For now we will handle the monitor category specially
let monitor_usage: number | undefined = 0;
Expand Down
Loading