diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 6d0c2681cfba..96605a229e94 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -77,7 +77,6 @@ import type {LastVisibleMessage} from './ReportActionsUtils'; import * as ReportActionsUtils from './ReportActionsUtils'; import * as ReportConnection from './ReportConnection'; import StringUtils from './StringUtils'; -import * as SubscriptionUtils from './SubscriptionUtils'; import * as TransactionUtils from './TransactionUtils'; import * as Url from './Url'; import type {AvatarSource} from './UserUtils'; @@ -2381,10 +2380,6 @@ function requiresAttentionFromCurrentUser(optionOrReport: OnyxEntry | Op return true; } - if (isChatUsedForOnboarding(optionOrReport) && SubscriptionUtils.hasUserFreeTrialEnded() && !SubscriptionUtils.doesUserHavePaymentCardAdded()) { - return true; - } - return false; } diff --git a/tests/unit/ReportUtilsTest.ts b/tests/unit/ReportUtilsTest.ts index 14c710c6ddf2..a21e3ea36476 100644 --- a/tests/unit/ReportUtilsTest.ts +++ b/tests/unit/ReportUtilsTest.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import {addDays, format as formatDate, subDays} from 'date-fns'; +import {addDays, format as formatDate} from 'date-fns'; import type {OnyxEntry} from 'react-native-onyx'; import Onyx from 'react-native-onyx'; import DateUtils from '@libs/DateUtils'; @@ -321,7 +321,7 @@ describe('ReportUtils', () => { expect(ReportUtils.requiresAttentionFromCurrentUser(report)).toBe(false); }); - it('returns false when the report has no oustanding IOU but is waiting for a bank account and the logged user is not the report owner', () => { + it('returns false when the report has no outstanding IOU but is waiting for a bank account and the logged user is not the report owner', () => { const report = { ...LHNTestUtils.getFakeReport(), ownerAccountID: 97, @@ -350,7 +350,7 @@ describe('ReportUtils', () => { expect(ReportUtils.requiresAttentionFromCurrentUser(report)).toBe(true); }); - it('returns true when the report has oustanding child expense', () => { + it('returns true when the report has outstanding child expense', () => { const report = { ...LHNTestUtils.getFakeReport(), ownerAccountID: 99, @@ -387,48 +387,6 @@ describe('ReportUtils', () => { expect(ReportUtils.requiresAttentionFromCurrentUser(report)).toBe(false); }); - - it('returns false if the user free trial has ended and it added a payment card', async () => { - await Onyx.multiSet({ - [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(addDays(new Date(), 1), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), // trial not ended - [ONYXKEYS.NVP_BILLING_FUND_ID]: 8010, // payment card added - }); - - const report: Report = { - ...LHNTestUtils.getFakeReport(), - chatType: CONST.REPORT.CHAT_TYPE.SYSTEM, - }; - - expect(ReportUtils.requiresAttentionFromCurrentUser(report)).toBe(false); - }); - - it("returns true if the report is the system chat, the user free trial has ended and it didn't add a payment card yet", async () => { - await Onyx.multiSet({ - [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(subDays(new Date(), 1), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), // trial ended - [ONYXKEYS.NVP_BILLING_FUND_ID]: null, // no payment card added - }); - - const report: Report = { - ...LHNTestUtils.getFakeReport(), - chatType: CONST.REPORT.CHAT_TYPE.SYSTEM, - }; - - expect(ReportUtils.requiresAttentionFromCurrentUser(report)).toBe(true); - }); - - it("returns true if the report is the concierge chat, the user free trial has ended and it didn't add a payment card yet", async () => { - await Onyx.multiSet({ - [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: formatDate(subDays(new Date(), 1), CONST.DATE.FNS_DATE_TIME_FORMAT_STRING), // trial ended - [ONYXKEYS.NVP_BILLING_FUND_ID]: null, // no payment card added - [ONYXKEYS.SESSION]: {email: currentUserEmail, accountID: 8}, // even account id - }); - - const report: Report = { - ...LHNTestUtils.getFakeReport([CONST.ACCOUNT_ID.CONCIERGE]), - }; - - expect(ReportUtils.requiresAttentionFromCurrentUser(report)).toBe(true); - }); }); describe('getMoneyRequestOptions', () => {