From 5b3e55acb9a2c0e46d2f104be68818c1fe344e83 Mon Sep 17 00:00:00 2001 From: gelocraft Date: Tue, 11 Nov 2025 04:22:32 +0000 Subject: [PATCH] fix(eslint): autofix all remaining `unicorn/prefer-set-has` violations --- __mocks__/react-native-permissions.ts | 5 ++--- src/components/Form/InputWrapper.tsx | 7 +++---- .../ReportActionItem/MoneyRequestReceiptView.tsx | 12 +++++------- src/libs/HttpUtils.ts | 5 ++--- src/libs/Middleware/SaveResponseInOnyx.ts | 10 +++------- src/libs/MoneyRequestReportUtils.ts | 5 ++--- .../GetStateForActionHandlers.ts | 7 +++---- src/libs/Navigation/Navigation.ts | 7 +++---- src/libs/ReportActionsUtils.ts | 5 ++--- src/libs/SearchQueryUtils.ts | 7 +++---- src/libs/actions/QueuedOnyxUpdates.ts | 7 +++---- src/pages/NewChatPage.tsx | 7 +++---- .../home/report/ContextMenu/ContextMenuActions.tsx | 10 +++++++--- src/pages/settings/Wallet/TransferBalancePage.tsx | 5 ++--- tests/actions/TourTest.ts | 11 +++++++---- 15 files changed, 50 insertions(+), 60 deletions(-) diff --git a/__mocks__/react-native-permissions.ts b/__mocks__/react-native-permissions.ts index d56f5296877d8..9ee11ea473f55 100644 --- a/__mocks__/react-native-permissions.ts +++ b/__mocks__/react-native-permissions.ts @@ -13,8 +13,7 @@ const request = jest.fn(() => RESULTS.GRANTED as string); const checkLocationAccuracy: jest.Mock = jest.fn(() => 'full'); const requestLocationAccuracy: jest.Mock = jest.fn(() => 'full'); -// eslint-disable-next-line unicorn/prefer-set-has -const notificationOptions: string[] = ['alert', 'badge', 'sound', 'carPlay', 'criticalAlert', 'provisional']; +const notificationOptions = new Set(['alert', 'badge', 'sound', 'carPlay', 'criticalAlert', 'provisional']); const notificationSettings: NotificationSettings = { alert: true, @@ -35,7 +34,7 @@ const checkNotifications: jest.Mock = jest.fn(() => ({ const requestNotifications: jest.Mock = jest.fn((options: Record) => ({ status: RESULTS.GRANTED, settings: Object.keys(options) - .filter((option: string) => notificationOptions.includes(option)) + .filter((option: string) => notificationOptions.has(option)) .reduce( (acc: NotificationSettings, option: string) => { acc[option] = true; diff --git a/src/components/Form/InputWrapper.tsx b/src/components/Form/InputWrapper.tsx index 0db5e1a11e98e..ee0de3478ac00 100644 --- a/src/components/Form/InputWrapper.tsx +++ b/src/components/Form/InputWrapper.tsx @@ -10,10 +10,9 @@ import type {ForwardedFSClassProps} from '@libs/Fullstory/types'; import FormContext from './FormContext'; import type {InputComponentBaseProps, InputComponentValueProps, ValidInputs, ValueTypeKey} from './types'; -type TextInputBasedComponents = [ComponentType, ComponentType]; +type TextInputBasedComponents = Set | ComponentType>; -// eslint-disable-next-line unicorn/prefer-set-has -const textInputBasedComponents: TextInputBasedComponents = [TextInput, RoomNameInput]; +const textInputBasedComponents: TextInputBasedComponents = new Set([TextInput, RoomNameInput]); type ComputedComponentSpecificRegistrationParams = { shouldSubmitForm: boolean; @@ -28,7 +27,7 @@ function computeComponentSpecificRegistrationParams({ autoGrowHeight, blurOnSubmit, }: InputComponentBaseProps): ComputedComponentSpecificRegistrationParams { - if (textInputBasedComponents.includes(InputComponent)) { + if (textInputBasedComponents.has(InputComponent)) { const isEffectivelyMultiline = !!multiline || !!autoGrowHeight; // If the user can use the hardware keyboard, they have access to an alternative way of inserting a new line diff --git a/src/components/ReportActionItem/MoneyRequestReceiptView.tsx b/src/components/ReportActionItem/MoneyRequestReceiptView.tsx index fce65f9885736..378262c6ef892 100644 --- a/src/components/ReportActionItem/MoneyRequestReceiptView.tsx +++ b/src/components/ReportActionItem/MoneyRequestReceiptView.tsx @@ -74,18 +74,16 @@ type MoneyRequestReceiptViewProps = { isDisplayedInWideRHP?: boolean; }; -// eslint-disable-next-line unicorn/prefer-set-has -const receiptImageViolationNames: OnyxTypes.ViolationName[] = [ +const receiptImageViolationNames = new Set([ CONST.VIOLATIONS.RECEIPT_REQUIRED, CONST.VIOLATIONS.RECEIPT_NOT_SMART_SCANNED, CONST.VIOLATIONS.CASH_EXPENSE_WITH_NO_RECEIPT, CONST.VIOLATIONS.SMARTSCAN_FAILED, CONST.VIOLATIONS.PROHIBITED_EXPENSE, CONST.VIOLATIONS.RECEIPT_GENERATED_WITH_AI, -]; +]); -// eslint-disable-next-line unicorn/prefer-set-has -const receiptFieldViolationNames: OnyxTypes.ViolationName[] = [CONST.VIOLATIONS.MODIFIED_AMOUNT, CONST.VIOLATIONS.MODIFIED_DATE]; +const receiptFieldViolationNames = new Set([CONST.VIOLATIONS.MODIFIED_AMOUNT, CONST.VIOLATIONS.MODIFIED_DATE]); function MoneyRequestReceiptView({ allReports, @@ -169,8 +167,8 @@ function MoneyRequestReceiptView({ const allViolations = []; for (const violation of transactionViolations ?? []) { - const isReceiptFieldViolation = receiptFieldViolationNames.includes(violation.name); - const isReceiptImageViolation = receiptImageViolationNames.includes(violation.name); + const isReceiptFieldViolation = receiptFieldViolationNames.has(violation.name); + const isReceiptImageViolation = receiptImageViolationNames.has(violation.name); if (isReceiptFieldViolation || isReceiptImageViolation) { const violationMessage = ViolationsUtils.getViolationTranslation(violation, translate, canEdit); allViolations.push(violationMessage); diff --git a/src/libs/HttpUtils.ts b/src/libs/HttpUtils.ts index 28c441c4dcd20..b36d68ddbf12d 100644 --- a/src/libs/HttpUtils.ts +++ b/src/libs/HttpUtils.ts @@ -42,8 +42,7 @@ abortControllerMap.set(ABORT_COMMANDS.SearchForReports, new AbortController()); /** * The API commands that require the skew calculation */ -// eslint-disable-next-line unicorn/prefer-set-has -const addSkewList: string[] = [WRITE_COMMANDS.OPEN_REPORT, SIDE_EFFECT_REQUEST_COMMANDS.RECONNECT_APP, WRITE_COMMANDS.OPEN_APP]; +const addSkewList = new Set([WRITE_COMMANDS.OPEN_REPORT, SIDE_EFFECT_REQUEST_COMMANDS.RECONNECT_APP, WRITE_COMMANDS.OPEN_APP]); /** * Regex to get API command from the command @@ -70,7 +69,7 @@ function processHTTPRequest(url: string, method: RequestType = 'get', body: Form .then((response) => { // We are calculating the skew to minimize the delay when posting the messages const match = url.match(APICommandRegex)?.[1]; - if (match && addSkewList.includes(match) && response.headers) { + if (match && addSkewList.has(match) && response.headers) { const dateHeaderValue = response.headers.get('Date'); const serverTime = dateHeaderValue ? new Date(dateHeaderValue).valueOf() : new Date().valueOf(); const endTime = new Date().valueOf(); diff --git a/src/libs/Middleware/SaveResponseInOnyx.ts b/src/libs/Middleware/SaveResponseInOnyx.ts index 8729444695269..3d6c575fb97cc 100644 --- a/src/libs/Middleware/SaveResponseInOnyx.ts +++ b/src/libs/Middleware/SaveResponseInOnyx.ts @@ -5,14 +5,13 @@ import type Middleware from './types'; // If we're executing any of these requests, we don't need to trigger our OnyxUpdates flow to update the current data even if our current value is out of // date because all these requests are updating the app to the most current state. -// eslint-disable-next-line unicorn/prefer-set-has -const requestsToIgnoreLastUpdateID: string[] = [ +const requestsToIgnoreLastUpdateID = new Set([ WRITE_COMMANDS.OPEN_APP, SIDE_EFFECT_REQUEST_COMMANDS.RECONNECT_APP, WRITE_COMMANDS.CLOSE_ACCOUNT, WRITE_COMMANDS.DELETE_MONEY_REQUEST, SIDE_EFFECT_REQUEST_COMMANDS.GET_MISSING_ONYX_MESSAGES, -]; +]); const SaveResponseInOnyx: Middleware = (requestResponse, request) => requestResponse.then((response = {}) => { @@ -32,10 +31,7 @@ const SaveResponseInOnyx: Middleware = (requestResponse, request) => response: response ?? {}, }; - if ( - requestsToIgnoreLastUpdateID.includes(request.command) || - !OnyxUpdates.doesClientNeedToBeUpdated({previousUpdateID: Number(response?.previousUpdateID ?? CONST.DEFAULT_NUMBER_ID)}) - ) { + if (requestsToIgnoreLastUpdateID.has(request.command) || !OnyxUpdates.doesClientNeedToBeUpdated({previousUpdateID: Number(response?.previousUpdateID ?? CONST.DEFAULT_NUMBER_ID)})) { return OnyxUpdates.apply(responseToApply); } diff --git a/src/libs/MoneyRequestReportUtils.ts b/src/libs/MoneyRequestReportUtils.ts index 28706b8038899..248c2ea890b2b 100644 --- a/src/libs/MoneyRequestReportUtils.ts +++ b/src/libs/MoneyRequestReportUtils.ts @@ -21,8 +21,7 @@ import {isTransactionPendingDelete} from './TransactionUtils'; * In MoneyRequestReport we filter out some IOU action types, because expense/transaction data is displayed in a separate list * at the top */ -// eslint-disable-next-line unicorn/prefer-set-has -const IOU_ACTIONS_TO_FILTER_OUT: Array = [CONST.IOU.REPORT_ACTION_TYPE.CREATE, CONST.IOU.REPORT_ACTION_TYPE.TRACK]; +const IOU_ACTIONS_TO_FILTER_OUT = new Set([CONST.IOU.REPORT_ACTION_TYPE.CREATE, CONST.IOU.REPORT_ACTION_TYPE.TRACK]); /** * Returns whether a specific action should be displayed in the feed/message list on MoneyRequestReportView. @@ -34,7 +33,7 @@ const IOU_ACTIONS_TO_FILTER_OUT: Array = [CONST.IOU. function isActionVisibleOnMoneyRequestReport(action: ReportAction) { if (isMoneyRequestAction(action)) { const originalMessage = getOriginalMessage(action); - return originalMessage ? !IOU_ACTIONS_TO_FILTER_OUT.includes(originalMessage.type) : false; + return originalMessage ? !IOU_ACTIONS_TO_FILTER_OUT.has(originalMessage.type) : false; } return action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED; diff --git a/src/libs/Navigation/AppNavigator/createRootStackNavigator/GetStateForActionHandlers.ts b/src/libs/Navigation/AppNavigator/createRootStackNavigator/GetStateForActionHandlers.ts index d40cef6a074c1..895c6606643e8 100644 --- a/src/libs/Navigation/AppNavigator/createRootStackNavigator/GetStateForActionHandlers.ts +++ b/src/libs/Navigation/AppNavigator/createRootStackNavigator/GetStateForActionHandlers.ts @@ -11,8 +11,7 @@ import NAVIGATORS from '@src/NAVIGATORS'; import SCREENS from '@src/SCREENS'; import type {OpenWorkspaceSplitActionType, PushActionType, ReplaceActionType, ToggleSidePanelWithHistoryActionType} from './types'; -// eslint-disable-next-line unicorn/prefer-set-has -const MODAL_ROUTES_TO_DISMISS: string[] = [ +const MODAL_ROUTES_TO_DISMISS = new Set([ NAVIGATORS.WORKSPACE_SPLIT_NAVIGATOR, NAVIGATORS.RIGHT_MODAL_NAVIGATOR, NAVIGATORS.ONBOARDING_MODAL_NAVIGATOR, @@ -28,7 +27,7 @@ const MODAL_ROUTES_TO_DISMISS: string[] = [ SCREENS.WORKSPACE_AVATAR, SCREENS.REPORT_AVATAR, SCREENS.CONCIERGE, -]; +]); const workspaceSplitsWithoutEnteringAnimation = new Set(); @@ -149,7 +148,7 @@ function handleDismissModalAction( const lastRoute = state.routes.at(-1); const newAction = StackActions.pop(); - if (!lastRoute?.name || !MODAL_ROUTES_TO_DISMISS.includes(lastRoute?.name)) { + if (!lastRoute?.name || !MODAL_ROUTES_TO_DISMISS.has(lastRoute?.name)) { Log.hmmm('[Navigation] dismissModal failed because there is no modal stack to dismiss'); return null; } diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index b751f16aa4079..565bc2499168f 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -35,13 +35,12 @@ import navigationRef from './navigationRef'; import type {NavigationPartialRoute, NavigationRoute, NavigationStateRoute, ReportsSplitNavigatorParamList, RootNavigatorParamList, State} from './types'; // Routes which are part of the flow to set up 2FA -// eslint-disable-next-line unicorn/prefer-set-has -const SET_UP_2FA_ROUTES: Route[] = [ +const SET_UP_2FA_ROUTES = new Set([ ROUTES.REQUIRE_TWO_FACTOR_AUTH, ROUTES.SETTINGS_2FA_ROOT.getRoute(ROUTES.REQUIRE_TWO_FACTOR_AUTH), ROUTES.SETTINGS_2FA_VERIFY.getRoute(ROUTES.REQUIRE_TWO_FACTOR_AUTH), ROUTES.SETTINGS_2FA_SUCCESS.getRoute(ROUTES.REQUIRE_TWO_FACTOR_AUTH), -]; +]); let account: OnyxEntry; // We have used `connectWithoutView` here because it is not connected to any UI @@ -91,7 +90,7 @@ type CanNavigateParams = { function canNavigate(methodName: string, params: CanNavigateParams = {}): boolean { // Block navigation if 2FA is required and the targetRoute is not part of the flow to enable 2FA const targetRoute = params.route ?? params.backToRoute; - if (shouldShowRequire2FAPage() && targetRoute && !SET_UP_2FA_ROUTES.includes(targetRoute)) { + if (shouldShowRequire2FAPage() && targetRoute && !SET_UP_2FA_ROUTES.has(targetRoute)) { Log.info(`[Navigation] Blocked navigation because 2FA is required to be set up to access route: ${targetRoute}`); return false; } diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index e814d44441812..ffb8297edc508 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -842,8 +842,7 @@ function isActionableWhisper( } const {POLICY_CHANGE_LOG: policyChangelogTypes, ROOM_CHANGE_LOG: roomChangeLogTypes, ...otherActionTypes} = CONST.REPORT.ACTIONS.TYPE; -// eslint-disable-next-line unicorn/prefer-set-has -const supportedActionTypes: ReportActionName[] = [...Object.values(otherActionTypes), ...Object.values(policyChangelogTypes), ...Object.values(roomChangeLogTypes)]; +const supportedActionTypes = new Set([...Object.values(otherActionTypes), ...Object.values(policyChangelogTypes), ...Object.values(roomChangeLogTypes)]); /** * Checks whether an action is actionable track expense and resolved. @@ -878,7 +877,7 @@ function shouldReportActionBeVisible(reportAction: OnyxEntry, key: } // Filter out any unsupported reportAction types - if (!supportedActionTypes.includes(reportAction.actionName)) { + if (!supportedActionTypes.has(reportAction.actionName)) { return false; } diff --git a/src/libs/SearchQueryUtils.ts b/src/libs/SearchQueryUtils.ts index 2d4b53d7817b9..62a94919170f8 100644 --- a/src/libs/SearchQueryUtils.ts +++ b/src/libs/SearchQueryUtils.ts @@ -186,13 +186,12 @@ function buildAmountFilterQuery(filterKey: SearchAmountFilterKeys, filterValues: */ function buildFilterValuesString(filterName: string, queryFilters: QueryFilter[]) { const delimiter = filterName === CONST.SEARCH.SYNTAX_FILTER_KEYS.KEYWORD ? ' ' : ','; - // eslint-disable-next-line unicorn/prefer-set-has - const allowedOps: string[] = [CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, CONST.SEARCH.SYNTAX_OPERATORS.NOT_EQUAL_TO]; + const allowedOps = new Set([CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, CONST.SEARCH.SYNTAX_OPERATORS.NOT_EQUAL_TO]); let filterValueString = ''; queryFilters.forEach((queryFilter, index) => { - const previousValueHasSameOp = allowedOps.includes(queryFilter.operator) && queryFilters?.at(index - 1)?.operator === queryFilter.operator; - const nextValueHasSameOp = allowedOps.includes(queryFilter.operator) && queryFilters?.at(index + 1)?.operator === queryFilter.operator; + const previousValueHasSameOp = allowedOps.has(queryFilter.operator) && queryFilters?.at(index - 1)?.operator === queryFilter.operator; + const nextValueHasSameOp = allowedOps.has(queryFilter.operator) && queryFilters?.at(index + 1)?.operator === queryFilter.operator; // If the previous queryFilter has the same operator (this rule applies only to eq and neq operators) then append the current value if (index !== 0 && (previousValueHasSameOp || nextValueHasSameOp)) { diff --git a/src/libs/actions/QueuedOnyxUpdates.ts b/src/libs/actions/QueuedOnyxUpdates.ts index ad129ca86773d..9fb826445f1f5 100644 --- a/src/libs/actions/QueuedOnyxUpdates.ts +++ b/src/libs/actions/QueuedOnyxUpdates.ts @@ -32,8 +32,7 @@ function flushQueue(): Promise { queuedOnyxUpdates = []; if (!currentAccountID && !CONFIG.IS_TEST_ENV && !CONFIG.E2E_TESTING) { - // eslint-disable-next-line unicorn/prefer-set-has - const preservedKeys: OnyxKey[] = [ + const preservedKeys = new Set([ ONYXKEYS.NVP_TRY_NEW_DOT, ONYXKEYS.NVP_TRY_FOCUS_MODE, ONYXKEYS.PREFERRED_THEME, @@ -50,9 +49,9 @@ function flushQueue(): Promise { ONYXKEYS.NETWORK, ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT, ONYXKEYS.PRESERVED_USER_SESSION, - ]; + ]); - copyUpdates = copyUpdates.filter((update) => preservedKeys.includes(update.key as OnyxKey)); + copyUpdates = copyUpdates.filter((update) => preservedKeys.has(update.key as OnyxKey)); } return Onyx.update(copyUpdates); } diff --git a/src/pages/NewChatPage.tsx b/src/pages/NewChatPage.tsx index 2cd590e5258d9..4d74bfc070c1a 100755 --- a/src/pages/NewChatPage.tsx +++ b/src/pages/NewChatPage.tsx @@ -48,8 +48,7 @@ import ROUTES from '@src/ROUTES'; import type {SelectedParticipant} from '@src/types/onyx/NewGroupChatDraft'; import KeyboardUtils from '@src/utils/keyboard'; -// eslint-disable-next-line unicorn/prefer-set-has -const excludedGroupEmails: string[] = CONST.EXPENSIFY_EMAILS.filter((value) => value !== CONST.EMAIL.CONCIERGE); +const excludedGroupEmails = new Set(CONST.EXPENSIFY_EMAILS.filter((value) => value !== CONST.EMAIL.CONCIERGE)); type SelectedOption = ListItem & Omit & { @@ -290,7 +289,7 @@ function NewChatPage({ref}: NewChatPageProps) { } if (selectedOptions.length && option) { // Prevent excluded emails from being added to groups - if (option?.login && excludedGroupEmails.includes(option.login)) { + if (option?.login && excludedGroupEmails.has(option.login)) { return; } toggleOption(option); @@ -317,7 +316,7 @@ function NewChatPage({ref}: NewChatPageProps) { const itemRightSideComponent = useCallback( (item: ListItem & Option, isFocused?: boolean) => { - if (!!item.isSelfDM || (item.login && excludedGroupEmails.includes(item.login))) { + if (!!item.isSelfDM || (item.login && excludedGroupEmails.has(item.login))) { return null; } diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index e3e35507a64d7..8aa4afa99d5ef 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -928,11 +928,15 @@ const ContextMenuActions: ContextMenuAction[] = [ }, ]; -// eslint-disable-next-line unicorn/prefer-set-has -const restrictedReadOnlyActions: TranslationPaths[] = ['reportActionContextMenu.replyInThread', 'reportActionContextMenu.editAction', 'reportActionContextMenu.joinThread', 'common.delete']; +const restrictedReadOnlyActions = new Set([ + 'reportActionContextMenu.replyInThread', + 'reportActionContextMenu.editAction', + 'reportActionContextMenu.joinThread', + 'common.delete', +]); const RestrictedReadOnlyContextMenuActions: ContextMenuAction[] = ContextMenuActions.filter( - (action) => 'textTranslateKey' in action && restrictedReadOnlyActions.includes(action.textTranslateKey), + (action) => 'textTranslateKey' in action && restrictedReadOnlyActions.has(action.textTranslateKey), ); export {RestrictedReadOnlyContextMenuActions}; diff --git a/src/pages/settings/Wallet/TransferBalancePage.tsx b/src/pages/settings/Wallet/TransferBalancePage.tsx index 8198c23dcdeb6..5ae8fc5db3532 100644 --- a/src/pages/settings/Wallet/TransferBalancePage.tsx +++ b/src/pages/settings/Wallet/TransferBalancePage.tsx @@ -34,8 +34,7 @@ import type PaymentMethod from '@src/types/onyx/PaymentMethod'; import type {FilterMethodPaymentType} from '@src/types/onyx/WalletTransfer'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; -// eslint-disable-next-line unicorn/prefer-set-has -const TRANSFER_TIER_NAMES: string[] = [CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM]; +const TRANSFER_TIER_NAMES = new Set([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM]); function TransferBalancePage() { const styles = useThemeStyles(); @@ -145,7 +144,7 @@ function TransferBalancePage() { const isButtonDisabled = !isTransferable || !selectedAccount; const errorMessage = getLatestErrorMessage(walletTransfer); - const shouldShowTransferView = hasExpensifyPaymentMethod(paymentCardList, bankAccountList ?? {}) && TRANSFER_TIER_NAMES.includes(userWallet?.tierName ?? ''); + const shouldShowTransferView = hasExpensifyPaymentMethod(paymentCardList, bankAccountList ?? {}) && TRANSFER_TIER_NAMES.has(userWallet?.tierName ?? ''); return ( { describe('NewDot users', () => { const onboardingChoices = Object.values(CONST.ONBOARDING_CHOICES); - // eslint-disable-next-line unicorn/prefer-set-has - const onboardingDemoChoices: OnboardingPurpose[] = [CONST.ONBOARDING_CHOICES.MANAGE_TEAM, CONST.ONBOARDING_CHOICES.TEST_DRIVE_RECEIVER, CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE]; + const onboardingDemoChoices = new Set([ + CONST.ONBOARDING_CHOICES.MANAGE_TEAM, + CONST.ONBOARDING_CHOICES.TEST_DRIVE_RECEIVER, + CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE, + ]); const accountID = 2; const conciergeChatReport: Report = LHNTestUtils.getFakeReport([accountID, CONST.ACCOUNT_ID.CONCIERGE]); const testDriveTaskReport: Report = {...LHNTestUtils.getFakeReport(), ownerAccountID: accountID}; @@ -84,7 +87,7 @@ describe('actions/Tour', () => { }); }; - it.each(onboardingChoices.filter((choice) => onboardingDemoChoices.includes(choice)))('should show the Test Drive demo if user has "%s" onboarding choice', async (choice) => { + it.each(onboardingChoices.filter((choice) => onboardingDemoChoices.has(choice)))('should show the Test Drive demo if user has "%s" onboarding choice', async (choice) => { await setTestDriveTaskData(); startTestDrive({choice}, false, false); @@ -93,7 +96,7 @@ describe('actions/Tour', () => { expect(Navigation.navigate).toHaveBeenCalledWith(ROUTES.TEST_DRIVE_DEMO_ROOT); }); - it.each(onboardingChoices.filter((choice) => !onboardingDemoChoices.includes(choice)))('should show the Test Drive modal if user has "%s" onboarding choice', async (choice) => { + it.each(onboardingChoices.filter((choice) => !onboardingDemoChoices.has(choice)))('should show the Test Drive modal if user has "%s" onboarding choice', async (choice) => { startTestDrive({choice}, false, false); await waitForBatchedUpdates();