diff --git a/src/libs/SubscriptionUtils.ts b/src/libs/SubscriptionUtils.ts index a19722dbd3af..2f940513152a 100644 --- a/src/libs/SubscriptionUtils.ts +++ b/src/libs/SubscriptionUtils.ts @@ -86,12 +86,6 @@ Onyx.connect({ }, }); -let lastDayFreeTrial: OnyxEntry; -Onyx.connect({ - key: ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, - callback: (value) => (lastDayFreeTrial = value), -}); - let userBillingGraceEndPeriodCollection: OnyxCollection; Onyx.connect({ key: ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END, @@ -169,12 +163,12 @@ function hasInsufficientFundsError() { return billingStatus?.declineReason === 'insufficient_funds' && getAmountOwed() !== 0; } -function shouldShowPreTrialBillingBanner(introSelected: OnyxEntry, firstDayFreeTrial: string | undefined): boolean { +function shouldShowPreTrialBillingBanner(introSelected: OnyxEntry, firstDayFreeTrial: string | undefined, lastDayFreeTrial: string | undefined): boolean { // We don't want to show the Pre Trial banner if the user was a Test Drive Receiver that created their workspace // with the promo code. const wasUserTestDriveReceiver = introSelected?.previousChoices?.some((choice) => choice === CONST.ONBOARDING_CHOICES.TEST_DRIVE_RECEIVER); - return !isUserOnFreeTrial(firstDayFreeTrial) && !hasUserFreeTrialEnded() && !wasUserTestDriveReceiver; + return !isUserOnFreeTrial(firstDayFreeTrial, lastDayFreeTrial) && !hasUserFreeTrialEnded(lastDayFreeTrial) && !wasUserTestDriveReceiver; } /** * @returns The card to be used for subscription billing. @@ -212,13 +206,14 @@ function shouldShowDiscountBanner( hasTeam2025Pricing: boolean, subscriptionPlan: ValueOf | null, firstDayFreeTrial: string | undefined, + lastDayFreeTrial: string | undefined, userBillingFundID: number | undefined, ): boolean { if (!getOwnedPaidPolicies(allPolicies, currentUserAccountID)?.length) { return false; } - if (!isUserOnFreeTrial(firstDayFreeTrial)) { + if (!isUserOnFreeTrial(firstDayFreeTrial, lastDayFreeTrial)) { return false; } @@ -416,7 +411,7 @@ function hasSubscriptionGreenDotInfo( /** * Calculates the remaining number of days of the workspace owner's free trial before it ends. */ -function calculateRemainingFreeTrialDays(): number { +function calculateRemainingFreeTrialDays(lastDayFreeTrial: string | undefined): number { if (!lastDayFreeTrial) { return 0; } @@ -438,17 +433,18 @@ function getFreeTrialText( policies: OnyxCollection | null, introSelected: OnyxEntry, firstDayFreeTrial: string | undefined, + lastDayFreeTrial: string | undefined, ): string | undefined { const ownedPaidPolicies = getOwnedPaidPolicies(policies, currentUserAccountID); if (isEmptyObject(ownedPaidPolicies)) { return undefined; } - if (shouldShowPreTrialBillingBanner(introSelected, firstDayFreeTrial)) { + if (shouldShowPreTrialBillingBanner(introSelected, firstDayFreeTrial, lastDayFreeTrial)) { return translate('subscription.billingBanner.preTrial.title'); } - if (isUserOnFreeTrial(firstDayFreeTrial)) { - return translate('subscription.billingBanner.trialStarted.title', {numOfDays: calculateRemainingFreeTrialDays()}); + if (isUserOnFreeTrial(firstDayFreeTrial, lastDayFreeTrial)) { + return translate('subscription.billingBanner.trialStarted.title', {numOfDays: calculateRemainingFreeTrialDays(lastDayFreeTrial)}); } return undefined; @@ -457,7 +453,7 @@ function getFreeTrialText( /** * Whether the workspace's owner is on its free trial period. */ -function isUserOnFreeTrial(firstDayFreeTrial: string | undefined): boolean { +function isUserOnFreeTrial(firstDayFreeTrial: string | undefined, lastDayFreeTrial: string | undefined): boolean { if (!firstDayFreeTrial || !lastDayFreeTrial) { return false; } @@ -474,7 +470,7 @@ function isUserOnFreeTrial(firstDayFreeTrial: string | undefined): boolean { /** * Whether the workspace owner's free trial period has ended. */ -function hasUserFreeTrialEnded(): boolean { +function hasUserFreeTrialEnded(lastDayFreeTrial: string | undefined): boolean { if (!lastDayFreeTrial) { return false; } diff --git a/src/pages/home/HeaderView.tsx b/src/pages/home/HeaderView.tsx index 526530fcb6d9..096120625bc1 100644 --- a/src/pages/home/HeaderView.tsx +++ b/src/pages/home/HeaderView.tsx @@ -206,7 +206,7 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked, // If the onboarding report is directly loaded, shouldShowDiscountBanner can return wrong value as it is not // linked to the react lifecycle directly. Wait for trial dates to load, before calculating. const shouldShowDiscount = useMemo( - () => shouldShowDiscountBanner(hasTeam2025Pricing, subscriptionPlan, firstDayFreeTrial, userBillingFundID) && !isReportArchived, + () => shouldShowDiscountBanner(hasTeam2025Pricing, subscriptionPlan, firstDayFreeTrial, lastDayFreeTrial, userBillingFundID) && !isReportArchived, // eslint-disable-next-line react-compiler/react-compiler // eslint-disable-next-line react-hooks/exhaustive-deps [firstDayFreeTrial, lastDayFreeTrial, hasTeam2025Pricing, reportNameValuePairs, subscriptionPlan, userBillingFundID], diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index 1adb14185fed..a0c0265c84f7 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -108,13 +108,14 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr const isScreenFocused = useIsSidebarRouteActive(NAVIGATORS.SETTINGS_SPLIT_NAVIGATOR, shouldUseNarrowLayout); const hasActivatedWallet = ([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM] as string[]).includes(userWallet?.tierName ?? ''); const [firstDayFreeTrial] = useOnyx(ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL, {canBeMissing: true}); + const [lastDayFreeTrial] = useOnyx(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, {canBeMissing: true}); const privateSubscription = usePrivateSubscription(); const subscriptionPlan = useSubscriptionPlan(); const previousUserPersonalDetails = usePrevious(currentUserPersonalDetails); const shouldLogout = useRef(false); - const freeTrialText = getFreeTrialText(translate, policies, introSelected, firstDayFreeTrial); + const freeTrialText = getFreeTrialText(translate, policies, introSelected, firstDayFreeTrial, lastDayFreeTrial); const shouldDisplayLHB = !shouldUseNarrowLayout; @@ -227,9 +228,10 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr styles.badgeSuccess, privateSubscription?.errors, stripeCustomerId, - freeTrialText, retryBillingSuccessful, billingDisputePending, + retryBillingFailed, + freeTrialText, ]); /** diff --git a/src/pages/settings/Subscription/CardSection/BillingBanner/TrialStartedBillingBanner.tsx b/src/pages/settings/Subscription/CardSection/BillingBanner/TrialStartedBillingBanner.tsx index fe807219c2af..6de323091743 100644 --- a/src/pages/settings/Subscription/CardSection/BillingBanner/TrialStartedBillingBanner.tsx +++ b/src/pages/settings/Subscription/CardSection/BillingBanner/TrialStartedBillingBanner.tsx @@ -9,12 +9,12 @@ import BillingBanner from './BillingBanner'; function TrialStartedBillingBanner() { const {translate} = useLocalize(); const [userBillingFundID] = useOnyx(ONYXKEYS.NVP_BILLING_FUND_ID, {canBeMissing: true}); - + const [lastDayFreeTrial] = useOnyx(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, {canBeMissing: true}); const subtitle = !doesUserHavePaymentCardAdded(userBillingFundID) ? translate('subscription.billingBanner.trialStarted.subtitle') : ''; return ( diff --git a/src/pages/settings/Subscription/CardSection/CardSection.tsx b/src/pages/settings/Subscription/CardSection/CardSection.tsx index 637604662ace..91de2ed1c235 100644 --- a/src/pages/settings/Subscription/CardSection/CardSection.tsx +++ b/src/pages/settings/Subscription/CardSection/CardSection.tsx @@ -66,6 +66,7 @@ function CardSection() { [purchaseList], ); const [firstDayFreeTrial] = useOnyx(ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL, {canBeMissing: true}); + const [lastDayFreeTrial] = useOnyx(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, {canBeMissing: true}); const [billingDisputePending] = useOnyx(ONYXKEYS.NVP_PRIVATE_BILLING_DISPUTE_PENDING, {canBeMissing: true}); const [userBillingFundID] = useOnyx(ONYXKEYS.NVP_BILLING_FUND_ID, {canBeMissing: true}); const requestRefund = useCallback(() => { @@ -142,13 +143,13 @@ function CardSection() { }; let BillingBanner: React.ReactNode | undefined; - if (shouldShowDiscountBanner(hasTeam2025Pricing, subscriptionPlan, firstDayFreeTrial, userBillingFundID)) { + if (shouldShowDiscountBanner(hasTeam2025Pricing, subscriptionPlan, firstDayFreeTrial, lastDayFreeTrial, userBillingFundID)) { BillingBanner = ; - } else if (shouldShowPreTrialBillingBanner(introSelected, firstDayFreeTrial)) { + } else if (shouldShowPreTrialBillingBanner(introSelected, firstDayFreeTrial, lastDayFreeTrial)) { BillingBanner = ; - } else if (isUserOnFreeTrial(firstDayFreeTrial)) { + } else if (isUserOnFreeTrial(firstDayFreeTrial, lastDayFreeTrial)) { BillingBanner = ; - } else if (hasUserFreeTrialEnded()) { + } else if (hasUserFreeTrialEnded(lastDayFreeTrial)) { BillingBanner = ; } if (billingStatus) { diff --git a/src/pages/settings/Subscription/FreeTrial.tsx b/src/pages/settings/Subscription/FreeTrial.tsx index a02ddf9da587..ba4de8d9bf09 100644 --- a/src/pages/settings/Subscription/FreeTrial.tsx +++ b/src/pages/settings/Subscription/FreeTrial.tsx @@ -38,7 +38,7 @@ function FreeTrial({badgeStyles, pressable = false, addSpacing = false, success if (!privateSubscription && !isOffline) { return; } - setFreeTrialText(getFreeTrialText(translate, policies, introSelected, firstDayFreeTrial)); + setFreeTrialText(getFreeTrialText(translate, policies, introSelected, firstDayFreeTrial, lastDayFreeTrial)); }, [isOffline, privateSubscription, translate, policies, firstDayFreeTrial, lastDayFreeTrial, introSelected]); if (!freeTrialText) { diff --git a/tests/unit/SubscriptionUtilsTest.ts b/tests/unit/SubscriptionUtilsTest.ts index f4cdbdc16532..71cbf62e9057 100644 --- a/tests/unit/SubscriptionUtilsTest.ts +++ b/tests/unit/SubscriptionUtilsTest.ts @@ -67,22 +67,24 @@ describe('SubscriptionUtils', () => { }); it('should return 0 if the Onyx key is not set', () => { - expect(calculateRemainingFreeTrialDays()).toBe(0); + expect(calculateRemainingFreeTrialDays(undefined)).toBe(0); }); it('should return 0 if the current date is after the free trial end date', async () => { await Onyx.set(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, formatDate(subDays(new Date(), 8), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING)); - expect(calculateRemainingFreeTrialDays()).toBe(0); + expect(calculateRemainingFreeTrialDays(undefined)).toBe(0); }); it('should return 1 if the current date is on the same day of the free trial end date, but some minutes earlier', async () => { - await Onyx.set(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, formatDate(addMinutes(new Date(), 30), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING)); - expect(calculateRemainingFreeTrialDays()).toBe(1); + const lastDayFreeTrial = formatDate(addMinutes(new Date(), 30), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); + await Onyx.set(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, lastDayFreeTrial); + expect(calculateRemainingFreeTrialDays(lastDayFreeTrial)).toBe(1); }); it('should return the remaining days if the current date is before the free trial end date', async () => { - await Onyx.set(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, formatDate(addDays(new Date(), 5), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING)); - expect(calculateRemainingFreeTrialDays()).toBe(5); + const lastDayFreeTrial = formatDate(addDays(new Date(), 5), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); + await Onyx.set(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, lastDayFreeTrial); + expect(calculateRemainingFreeTrialDays(lastDayFreeTrial)).toBe(5); }); }); @@ -96,7 +98,7 @@ describe('SubscriptionUtils', () => { }); it('should return false if the Onyx keys are not set', () => { - expect(isUserOnFreeTrial(undefined)).toBeFalsy(); + expect(isUserOnFreeTrial(undefined, undefined)).toBeFalsy(); }); it('should return false if the current date is before the free trial start date', async () => { @@ -106,7 +108,7 @@ describe('SubscriptionUtils', () => { [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(addDays(new Date(), 4), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), }); - expect(isUserOnFreeTrial(firstDayFreeTrial)).toBeFalsy(); + expect(isUserOnFreeTrial(firstDayFreeTrial, undefined)).toBeFalsy(); }); it('should return false if the current date is after the free trial end date', async () => { @@ -116,37 +118,40 @@ describe('SubscriptionUtils', () => { [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(subDays(new Date(), 2), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), }); - expect(isUserOnFreeTrial(firstDayFreeTrial)).toBeFalsy(); + expect(isUserOnFreeTrial(firstDayFreeTrial, undefined)).toBeFalsy(); }); it('should return true if the current date is on the same date of free trial start date', async () => { const firstDayFreeTrial = formatDate(new Date(), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); + const lastDayFreeTrial = formatDate(addDays(new Date(), 3), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); await Onyx.multiSet({ [ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: firstDayFreeTrial, - [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(addDays(new Date(), 3), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), + [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: lastDayFreeTrial, }); - expect(isUserOnFreeTrial(firstDayFreeTrial)).toBeTruthy(); + expect(isUserOnFreeTrial(firstDayFreeTrial, lastDayFreeTrial)).toBeTruthy(); }); it('should return true if the current date is on the same date of free trial end date, but some minutes earlier', async () => { const firstDayFreeTrial = formatDate(subDays(new Date(), 2), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); + const lastDayFreeTrial = formatDate(addMinutes(new Date(), 30), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); await Onyx.multiSet({ [ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: firstDayFreeTrial, - [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(addMinutes(new Date(), 30), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), + [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: lastDayFreeTrial, }); - expect(isUserOnFreeTrial(firstDayFreeTrial)).toBeTruthy(); + expect(isUserOnFreeTrial(firstDayFreeTrial, lastDayFreeTrial)).toBeTruthy(); }); it('should return true if the current date is between the free trial start and end dates', async () => { const firstDayFreeTrial = formatDate(subDays(new Date(), 1), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); + const lastDayFreeTrial = formatDate(addDays(new Date(), 3), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); await Onyx.multiSet({ [ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: firstDayFreeTrial, - [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(addDays(new Date(), 3), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), + [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: lastDayFreeTrial, }); - expect(isUserOnFreeTrial(firstDayFreeTrial)).toBeTruthy(); + expect(isUserOnFreeTrial(firstDayFreeTrial, lastDayFreeTrial)).toBeTruthy(); }); }); @@ -160,17 +165,18 @@ describe('SubscriptionUtils', () => { }); it('should return false if the Onyx key is not set', () => { - expect(hasUserFreeTrialEnded()).toBeFalsy(); + expect(hasUserFreeTrialEnded(undefined)).toBeFalsy(); }); it('should return false if the current date is before the free trial end date', async () => { await Onyx.set(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, formatDate(addDays(new Date(), 1), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING)); - expect(hasUserFreeTrialEnded()).toBeFalsy(); + expect(hasUserFreeTrialEnded(undefined)).toBeFalsy(); }); it('should return true if the current date is after the free trial end date', async () => { - await Onyx.set(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, formatDate(subDays(new Date(), 2), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING)); - expect(hasUserFreeTrialEnded()).toBeTruthy(); + const lastDayFreeTrial = formatDate(subDays(new Date(), 2), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); + await Onyx.set(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL, lastDayFreeTrial); + expect(hasUserFreeTrialEnded(lastDayFreeTrial)).toBeTruthy(); }); }); @@ -529,7 +535,7 @@ describe('SubscriptionUtils', () => { [ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: null, [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: null, }); - expect(shouldShowDiscountBanner(true, 'corporate', undefined, undefined)).toBeFalsy(); + expect(shouldShowDiscountBanner(true, 'corporate', undefined, undefined, undefined)).toBeFalsy(); }); it(`should return false if user has already added a payment method`, async () => { @@ -542,7 +548,7 @@ describe('SubscriptionUtils', () => { }, [ONYXKEYS.NVP_BILLING_FUND_ID]: 8010, }); - expect(shouldShowDiscountBanner(true, 'corporate', undefined, 8010)).toBeFalsy(); + expect(shouldShowDiscountBanner(true, 'corporate', undefined, undefined, 8010)).toBeFalsy(); }); it('should return false if the user is on Team plan', async () => { @@ -557,11 +563,12 @@ describe('SubscriptionUtils', () => { [ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: firstDayFreeTrial, [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(addDays(new Date(), 10), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), }); - expect(shouldShowDiscountBanner(true, 'team', firstDayFreeTrial, undefined)).toBeFalsy(); + expect(shouldShowDiscountBanner(true, 'team', firstDayFreeTrial, undefined, undefined)).toBeFalsy(); }); it('should return true if the date is before the free trial end date or within the 8 days from the trial start date', async () => { const firstDayFreeTrial = formatDate(subDays(new Date(), 1), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); + const lastDayFreeTrial = formatDate(addDays(new Date(), 10), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); await Onyx.multiSet({ [ONYXKEYS.SESSION]: {accountID: ownerAccountID}, [`${ONYXKEYS.COLLECTION.POLICY}${policyID}` as const]: { @@ -570,9 +577,9 @@ describe('SubscriptionUtils', () => { type: CONST.POLICY.TYPE.CORPORATE, }, [ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: firstDayFreeTrial, - [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(addDays(new Date(), 10), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), + [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: lastDayFreeTrial, }); - expect(shouldShowDiscountBanner(true, 'corporate', firstDayFreeTrial, undefined)).toBeTruthy(); + expect(shouldShowDiscountBanner(true, 'corporate', firstDayFreeTrial, lastDayFreeTrial, undefined)).toBeTruthy(); }); it("should return false if user's trial is during the discount period but has no workspaces", async () => { @@ -582,7 +589,7 @@ describe('SubscriptionUtils', () => { [ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: firstDayFreeTrial, [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(addDays(new Date(), 10), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), }); - expect(shouldShowDiscountBanner(true, 'corporate', firstDayFreeTrial, undefined)).toBeFalsy(); + expect(shouldShowDiscountBanner(true, 'corporate', firstDayFreeTrial, undefined, undefined)).toBeFalsy(); }); }); @@ -655,21 +662,22 @@ describe('SubscriptionUtils', () => { choice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM, }; - expect(shouldShowPreTrialBillingBanner(introSelected, firstDayFreeTrial)).toBeTruthy(); + expect(shouldShowPreTrialBillingBanner(introSelected, firstDayFreeTrial, undefined)).toBeTruthy(); }); it('should return false if the free trial has ended', async () => { const firstDayFreeTrial = formatDate(subDays(new Date(), 20), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); + const lastDayFreeTrial = formatDate(subDays(new Date(), 5), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING); await Onyx.multiSet({ [ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: firstDayFreeTrial, - [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(subDays(new Date(), 5), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), + [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: lastDayFreeTrial, }); const introSelected: OnyxEntry = { choice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM, }; - expect(shouldShowPreTrialBillingBanner(introSelected, firstDayFreeTrial)).toBeFalsy(); + expect(shouldShowPreTrialBillingBanner(introSelected, firstDayFreeTrial, lastDayFreeTrial)).toBeFalsy(); }); }); describe('shouldCalculateBillNewDot', () => {