diff --git a/static/gsAdmin/components/customers/customerOverview.spec.tsx b/static/gsAdmin/components/customers/customerOverview.spec.tsx index 1881f60e01c3e5..ad2df0dade2323 100644 --- a/static/gsAdmin/components/customers/customerOverview.spec.tsx +++ b/static/gsAdmin/components/customers/customerOverview.spec.tsx @@ -367,13 +367,12 @@ describe('CustomerOverview', function () { expect(screen.queryByText('Seer:')).not.toBeInTheDocument(); }); - it('renders no product trials for non-self-serve account', function () { + it('renders product trials for non-self-serve account', function () { const organization = OrganizationFixture(); - const enterprise_subscription = SubscriptionFixture({ + const enterprise_subscription = InvoicedSubscriptionFixture({ organization, plan: 'am3_business_ent_auf', planTier: PlanTier.AM3, - canSelfServe: false, }); render( @@ -384,12 +383,12 @@ describe('CustomerOverview', function () { /> ); - expect(screen.queryByText('Product Trials')).not.toBeInTheDocument(); - expect(screen.queryByText('Replays:')).not.toBeInTheDocument(); - expect(screen.queryByText('Spans:')).not.toBeInTheDocument(); + expect(screen.getByText('Product Trials')).toBeInTheDocument(); + expect(screen.getByText('Spans:')).toBeInTheDocument(); + expect(screen.getByText('Replays:')).toBeInTheDocument(); + expect(screen.getByText('Seer:')).toBeInTheDocument(); expect(screen.queryByText('Performance Units:')).not.toBeInTheDocument(); expect(screen.queryByText('Transactions:')).not.toBeInTheDocument(); - expect(screen.queryByText('Seer:')).not.toBeInTheDocument(); }); it('render product trials for am1 account', function () { diff --git a/static/gsAdmin/components/customers/customerOverview.tsx b/static/gsAdmin/components/customers/customerOverview.tsx index 55c50872c1ec20..01b5e934fde544 100644 --- a/static/gsAdmin/components/customers/customerOverview.tsx +++ b/static/gsAdmin/components/customers/customerOverview.tsx @@ -438,19 +438,15 @@ function CustomerOverview({customer, onAction, organization}: Props) { ); const region = regionMap[organization.links.regionUrl] ?? '??'; - const productTrialCategories = customer.canSelfServe - ? Object.values(BILLED_DATA_CATEGORY_INFO).filter( - categoryInfo => - categoryInfo.canProductTrial && - customer.planDetails.categories.includes(categoryInfo.plural) - ) - : []; - - const productTrialCategoryGroups = customer.canSelfServe - ? Object.values(customer.planDetails.availableReservedBudgetTypes).filter( - group => group.canProductTrial - ) - : []; + const productTrialCategories = Object.values(BILLED_DATA_CATEGORY_INFO).filter( + categoryInfo => + categoryInfo.canProductTrial && + customer.planDetails?.categories.includes(categoryInfo.plural) + ); + + const productTrialCategoryGroups = Object.values( + customer.planDetails?.availableReservedBudgetTypes || {} + ).filter(group => group.canProductTrial); function updateCustomerStatus(action: string, type: string) { const data = {