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
40 changes: 0 additions & 40 deletions static/gsApp/components/features/planFeature.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,46 +171,6 @@ describe('PlanFeature', () => {
});
});

it('returns global-views in business plan even if response does not include it', async () => {
const mockFn = jest.fn(() => null);

const sub = SubscriptionFixture({organization, planTier: PlanTier.MM2});
SubscriptionStore.set(organization.slug, sub);

render(
<PlanFeature organization={organization} features={['global-views']}>
{mockFn}
</PlanFeature>
);

await waitFor(() => {
expect(mockFn).toHaveBeenCalledWith({
plan: PlanDetailsLookupFixture('am2_business'),
tierChange: 'am2',
});
});
});

it('returns business plan with other features including global-views', async () => {
const mockFn = jest.fn(() => null);

const sub = SubscriptionFixture({organization, planTier: PlanTier.MM2});
SubscriptionStore.set(organization.slug, sub);

render(
<PlanFeature organization={organization} features={['global-views', 'sso-basic']}>
{mockFn}
</PlanFeature>
);

await waitFor(() => {
expect(mockFn).toHaveBeenCalledWith({
plan: PlanDetailsLookupFixture('am2_business'),
tierChange: 'am2',
});
});
});

it('returns dashboards-basic in team plan even if response does not include it', async () => {
const mockFn = jest.fn(() => null);

Expand Down
10 changes: 2 additions & 8 deletions static/gsApp/components/features/planFeature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import withSubscription from 'getsentry/components/withSubscription';
import {useBillingConfig} from 'getsentry/hooks/useBillingConfig';
import type {Plan, Subscription} from 'getsentry/types';
import {
isAmEnterprisePlan,
isBizPlanFamily,
isDeveloperPlan,
isTeamPlanFamily,
Expand Down Expand Up @@ -110,16 +109,11 @@ function PlanFeature({subscription, features, organization, children}: Props) {
plans = billingConfig.planList;
}

// HACK: we want to remove `global-views` from getsentry and move it to flagpole,
// HACK: we want to remove certain flags from getsentry and move them to flagpole,
// but since PlanFeature hooks into getsentry to determine which plan
// `global-views` is in, we need to hardcode it into the plans here
// has which features, we need to hardcode it into the plans here
// TODO: remove this
for (const plan of plans) {
if (isBizPlanFamily(plan) || isAmEnterprisePlan(plan.id)) {
if (!plan.features.includes('global-views')) {
plan.features.push('global-views');
}
}
if (isBizPlanFamily(plan)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@narsaynorath i saw you also have dashboard-related flags here — are these safe to clean up as well?

if (!plan.features.includes('dashboards-edit')) {
plan.features.push('dashboards-edit');
Expand Down
Loading