Skip to content
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
31 changes: 1 addition & 30 deletions static/gsAdmin/components/changePlanAction.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('ChangePlanAction', () => {
// Verify the tabs are rendered
expect(screen.getByRole('tab', {name: 'AM3'})).toBeInTheDocument();
expect(screen.getByRole('tab', {name: 'AM2'})).toBeInTheDocument();
expect(screen.getByRole('tab', {name: 'MM2'})).toBeInTheDocument();
expect(screen.queryByRole('tab', {name: 'MM2'})).not.toBeInTheDocument();

// Verify at least one plan option is displayed
expect(screen.getByTestId('change-plan-label-am3_business')).toBeInTheDocument();
Expand Down Expand Up @@ -324,16 +324,6 @@ describe('ChangePlanAction', () => {
const radios = document.querySelectorAll('input[type="radio"]');
expect(radios.length).toBeGreaterThan(0);
});

// Switch to MM2 tier
const mm2Tab = screen.getByRole('tab', {name: 'MM2'});
await userEvent.click(mm2Tab);

// Again, verify we have plan options
await waitFor(() => {
const radios = document.querySelectorAll('input[type="radio"]');
expect(radios.length).toBeGreaterThan(0);
});
});

it('shows only test plans when using TEST tier', async () => {
Expand Down Expand Up @@ -448,25 +438,6 @@ describe('ChangePlanAction', () => {
expect(screen.getByText('Seer')).toBeInTheDocument();
});

it('hides Seer budget checkbox for MM2 tier', async () => {
openAndLoadModal();

await waitFor(() => {
expect(screen.getByRole('tab', {name: 'AM3'})).toBeInTheDocument();
});

const mm2Tab = screen.getByRole('tab', {name: 'MM2'});
await userEvent.click(mm2Tab);

await userEvent.click(screen.getAllByRole('radio')[0] as HTMLElement);

expect(
screen.queryByRole('checkbox', {
name: 'Seer',
})
).not.toBeInTheDocument();
});

it('initializes Seer budget checkbox based on current subscription', async () => {
// Create subscription with Seer budget
const subscriptionWithSeer = SubscriptionWithLegacySeerFixture({
Expand Down
36 changes: 1 addition & 35 deletions static/gsAdmin/components/changePlanAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {ANNUAL, MONTHLY} from 'getsentry/constants';
import type {BillingConfig, Plan, Subscription} from 'getsentry/types';
import {CheckoutType, PlanTier} from 'getsentry/types';

const ALLOWED_TIERS = [PlanTier.MM2, PlanTier.AM1, PlanTier.AM2, PlanTier.AM3];
const ALLOWED_TIERS = [PlanTier.AM1, PlanTier.AM2, PlanTier.AM3];

type Props = {
onSuccess: () => void;
Expand Down Expand Up @@ -206,20 +206,6 @@ function ChangePlanAction({
return;
}

if (activeTier === PlanTier.MM2) {
try {
await api.requestPromise(`/customers/${orgId}/`, {
method: 'PUT',
data,
});
onSubmitSuccess(data);
} catch (error) {
onSubmitError(error);
}
return;
}

// AM plans use a different endpoint to update plans
try {
await api.requestPromise(`/customers/${orgId}/subscription/`, {
method: 'PUT',
Expand Down Expand Up @@ -247,10 +233,6 @@ function ChangePlanAction({
label: 'AM1',
tier: PlanTier.AM1,
},
{
label: 'MM2',
tier: PlanTier.MM2,
},
{
label: 'TEST',
tier: PlanTier.TEST,
Expand Down Expand Up @@ -293,22 +275,6 @@ function ChangePlanAction({
Monthly
</a>
</li>
{activeTier === PlanTier.MM2 && (
<li
className={classNames({
active: contractInterval === ANNUAL && billingInterval === MONTHLY,
})}
>
<a
onClick={() => {
setBillingInterval(MONTHLY);
setContractInterval(ANNUAL);
}}
>
Annual (Contract)
</a>
</li>
)}
<li
className={classNames({
active: contractInterval === ANNUAL && billingInterval === ANNUAL,
Expand Down
Loading