From 2f21752da38ac29d2f6d0f550c11f4fef3545cd3 Mon Sep 17 00:00:00 2001 From: Calvin Yau Date: Tue, 22 Oct 2024 10:20:47 -0700 Subject: [PATCH] fix: Fix cancel test --- .../CurrentOrgPlan/CurrentOrgPlan.test.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentOrgPlan.test.tsx b/src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentOrgPlan.test.tsx index 2a7c1c4ce2..9567b69b02 100644 --- a/src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentOrgPlan.test.tsx +++ b/src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentOrgPlan.test.tsx @@ -81,7 +81,8 @@ const mockEnterpriseAccountDetailsHundredPercent = { } const alertOptionWrapperCreator = ( - alertOptionString: AlertOptionsType | '' + alertOptionString: AlertOptionsType | '', + isCancellation?: boolean ) => { const wrapper: React.FC = ({ children }) => ( @@ -89,7 +90,10 @@ const alertOptionWrapperCreator = ( @@ -105,6 +109,7 @@ const alertOptionWrapperCreator = ( const server = setupServer() const wrapper = alertOptionWrapperCreator(AlertOptions.SUCCESS) const noUpdatedPlanWrapper = alertOptionWrapperCreator('') +const cancellationPlanWrapper = alertOptionWrapperCreator('', true) beforeAll(() => server.listen()) afterEach(() => { @@ -228,7 +233,7 @@ describe('CurrentOrgPlan', () => { }) describe('when info message cancellation should be shown', () => { - it('renders when subscription detail data is available', async () => { + it.only('renders when subscription detail data is available', async () => { setup({ accountDetails: { plan: { @@ -245,7 +250,7 @@ describe('CurrentOrgPlan', () => { } as z.infer, }) - render(, { wrapper: noUpdatedPlanWrapper }) + render(, { wrapper: cancellationPlanWrapper }) const pendingCancellation = await screen.findByText( /on August 2nd 2024, 8:52 p.m./ )