From dcac61e4d9ab7c6dd1985cb2c4d6d46d2c905d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Fri, 16 Jun 2023 13:35:24 +0200 Subject: [PATCH] fix: add trial expired warning for enterprise (#3997) Adds the trial expired warning for enterprise as well. --- .../BillingPlan/BillingPlan.tsx | 1 + .../common/InstanceStatus/InstanceStatus.tsx | 2 +- .../InstanceStatus/InstanceStatusBar.test.tsx | 14 +++++++ .../InstanceStatusBar.test.tsx.snap | 40 +++++++++++++++++++ frontend/src/interfaces/instance.ts | 1 + 5 files changed, 57 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx b/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx index d5e67e046c..d42edabd77 100644 --- a/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx +++ b/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx @@ -82,6 +82,7 @@ export const BillingPlan: FC = ({ instanceStatus }) => { [InstancePlan.PRO]: 80, [InstancePlan.COMPANY]: 0, [InstancePlan.TEAM]: 0, + [InstancePlan.ENTERPRISE]: 0, [InstancePlan.UNKNOWN]: 0, user: 15, }; diff --git a/frontend/src/component/common/InstanceStatus/InstanceStatus.tsx b/frontend/src/component/common/InstanceStatus/InstanceStatus.tsx index 25282e2077..62f1213dc3 100644 --- a/frontend/src/component/common/InstanceStatus/InstanceStatus.tsx +++ b/frontend/src/component/common/InstanceStatus/InstanceStatus.tsx @@ -104,7 +104,7 @@ export const InstanceStatus: FC = ({ children }) => { return ( <> ( <> { expect(await screen.findByTestId(INSTANCE_STATUS_BAR_ID)).toMatchSnapshot(); }); +test('InstanceStatusBar should warn when the trial has expired for enterprise', async () => { + render( + + ); + + expect(screen.getByTestId(INSTANCE_STATUS_BAR_ID)).toBeInTheDocument(); + expect(await screen.findByTestId(INSTANCE_STATUS_BAR_ID)).toMatchSnapshot(); +}); + test('InstanceStatusBar should warn when the trial has churned', async () => { render( `; +exports[`InstanceStatusBar should warn when the trial has expired for enterprise 1`] = ` + +`; + exports[`InstanceStatusBar should warn when the trial is about to expire 1`] = `