Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/AddPaymentMethodMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function AddPaymentMethodMenu({
const [restoreFocusType, setRestoreFocusType] = useState<BaseModalProps['restoreFocusType']>();
const [session] = useOnyx(ONYXKEYS.SESSION);
const [introSelected, introSelectedStatus] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [betas] = useOnyx(ONYXKEYS.BETAS);

// Users can choose to pay with business bank account in case of Expense reports or in case of P2P IOU report
// which then starts a bottom up flow and creates a Collect workspace where the payer is an admin and payee is an employee.
Expand All @@ -78,9 +79,9 @@ function AddPaymentMethodMenu({
return;
}

completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected);
completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected, betas);
onItemSelected(CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT);
}, [introSelected, introSelectedStatus, introSelectedStatus.status, isPersonalOnlyOption, isVisible, onItemSelected]);
}, [betas, introSelected, introSelectedStatus, introSelectedStatus.status, isPersonalOnlyOption, isVisible, onItemSelected]);

if (isPersonalOnlyOption) {
return null;
Expand All @@ -107,7 +108,7 @@ function AddPaymentMethodMenu({
text: translate('common.personalBankAccount'),
icon: icons.Bank,
onSelected: () => {
completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected);
completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected, betas);
onItemSelected(CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT);
},
},
Expand Down
4 changes: 3 additions & 1 deletion src/components/KYCWall/BaseKYCWall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function KYCWall({
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`);
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT);

const {formatPhoneNumber} = useLocalize();
Expand Down Expand Up @@ -167,7 +168,7 @@ function KYCWall({
if (policyID && iouReport?.policyID) {
savePreferredPaymentMethod(iouReport.policyID, policyID, CONST.LAST_PAYMENT_METHOD.IOU, lastPaymentMethod?.[iouReport?.policyID]);
}
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, introSelected, adminsChatReportID, policyID);
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, introSelected, betas, adminsChatReportID, policyID);
if (workspaceChatReportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(workspaceChatReportID, reportPreviewReportActionID));
}
Expand Down Expand Up @@ -212,6 +213,7 @@ function KYCWall({
introSelected,
formatPhoneNumber,
lastPaymentMethod,
betas,
],
);

Expand Down
4 changes: 3 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@
};

let conciergeReportIDOnyxConnect: OnyxEntry<string>;
Onyx.connect({

Check warning on line 1018 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.CONCIERGE_REPORT_ID,
callback: (value) => {
conciergeReportIDOnyxConnect = value;
Expand All @@ -1023,7 +1023,7 @@
});

const defaultAvatarBuildingIconTestID = 'SvgDefaultAvatarBuilding Icon';
Onyx.connect({

Check warning on line 1026 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val is undefined
Expand All @@ -1041,7 +1041,7 @@
let allPersonalDetails: OnyxEntry<PersonalDetailsList>;
let allPersonalDetailLogins: string[];
let currentUserPersonalDetails: OnyxEntry<PersonalDetails>;
Onyx.connect({

Check warning on line 1044 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
if (currentUserAccountID) {
Expand All @@ -1053,7 +1053,7 @@
});

let allReportsDraft: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 1056 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_DRAFT,
waitForCollectionCallback: true,
callback: (value) => (allReportsDraft = value),
Expand All @@ -1062,7 +1062,7 @@
let allPolicies: OnyxCollection<Policy>;
let hasPolicies: boolean;
let policiesArray: Policy[] = [];
Onyx.connect({

Check warning on line 1065 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -1073,7 +1073,7 @@
});

let allPolicyDrafts: OnyxCollection<Policy>;
Onyx.connect({

Check warning on line 1076 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY_DRAFTS,
waitForCollectionCallback: true,
callback: (value) => (allPolicyDrafts = value),
Expand All @@ -1081,7 +1081,7 @@

let allReports: OnyxCollection<Report>;
let reportsByPolicyID: ReportByPolicyMap;
Onyx.connect({

Check warning on line 1084 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -1117,14 +1117,14 @@
});

let betaConfiguration: OnyxEntry<BetaConfiguration> = {};
Onyx.connect({

Check warning on line 1120 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.BETA_CONFIGURATION,
callback: (value) => (betaConfiguration = value ?? {}),
});

let allTransactions: OnyxCollection<Transaction> = {};
let reportsTransactions: Record<string, Transaction[]> = {};
Onyx.connect({

Check warning on line 1127 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -1150,7 +1150,7 @@
});

let allReportActions: OnyxCollection<ReportActions>;
Onyx.connect({

Check warning on line 1153 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand Down Expand Up @@ -11424,6 +11424,7 @@
isInvitedAccountant?: boolean;
onboardingPurposeSelected?: OnboardingPurpose;
isSelfTourViewed?: boolean;
betas?: OnyxEntry<Beta[]>;
};

function prepareOnboardingOnyxData({
Expand All @@ -11439,6 +11440,7 @@
isInvitedAccountant,
onboardingPurposeSelected,
isSelfTourViewed,
betas,
}: PrepareOnboardingOnyxDataParams) {
if (engagementChoice === CONST.ONBOARDING_CHOICES.PERSONAL_SPEND) {
// eslint-disable-next-line no-param-reassign
Expand All @@ -11453,7 +11455,7 @@
// Only the MANAGE_TEAM onboarding action uses the #admins room (with a guide); TRACK_WORKSPACE uses Concierge. Excludes emails that have a '+'.
const shouldPostTasksInAdminsRoom = isPostingTasksInAdminsRoom(engagementChoice);
// When posting to admins room and the user is in the suggestedFollowups beta, we skip tasks in favor of backend-generated followups.
const shouldUseFollowupsInsteadOfTasks = shouldPostTasksInAdminsRoom && Permissions.isBetaEnabled(CONST.BETAS.SUGGESTED_FOLLOWUPS, allBetas, betaConfiguration);
const shouldUseFollowupsInsteadOfTasks = shouldPostTasksInAdminsRoom && Permissions.isBetaEnabled(CONST.BETAS.SUGGESTED_FOLLOWUPS, betas ?? allBetas, betaConfiguration);
const adminsChatReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${adminsChatReportID}`];
const targetChatReport = shouldPostTasksInAdminsRoom
? (adminsChatReport ?? {reportID: adminsChatReportID, policyID: onboardingPolicyID})
Expand Down
7 changes: 5 additions & 2 deletions src/libs/actions/IOU/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6771,6 +6771,7 @@ function requestMoney(requestMoneyInformation: RequestMoneyInformation): {iouRep
onboardingMessage: getOnboardingMessages().onboardingMessages[CONST.ONBOARDING_CHOICES.TEST_DRIVE_RECEIVER],
companySize: undefined,
isSelfTourViewed,
betas,
})?.guidedSetupData
: undefined;

Expand Down Expand Up @@ -11932,6 +11933,7 @@ function cancelPayment(
function completePaymentOnboarding(
paymentSelected: ValueOf<typeof CONST.PAYMENT_SELECTED>,
introSelected: OnyxEntry<OnyxTypes.IntroSelected>,
betas: OnyxEntry<OnyxTypes.Beta[]>,
adminsChatReportID?: string,
onboardingPolicyID?: string,
) {
Expand Down Expand Up @@ -11966,6 +11968,7 @@ function completePaymentOnboarding(
shouldSkipTestDriveModal: true,
companySize: introSelected?.companySize as OnboardingCompanySize,
introSelected,
betas,
});
}

Expand All @@ -11977,7 +11980,7 @@ function payMoneyRequest(params: PayMoneyRequestFunctionParams) {
}

const paymentSelected = paymentType === CONST.IOU.PAYMENT_TYPE.VBBA ? CONST.IOU.PAYMENT_SELECTED.BBA : CONST.IOU.PAYMENT_SELECTED.PBA;
completePaymentOnboarding(paymentSelected, introSelected);
completePaymentOnboarding(paymentSelected, introSelected, betas);

const recipient = {accountID: iouReport?.ownerAccountID ?? CONST.DEFAULT_NUMBER_ID};
const {params: payMoneyRequestParams, onyxData} = getPayMoneyRequestParams({
Expand Down Expand Up @@ -12052,7 +12055,7 @@ function payInvoice({
});

const paymentSelected = paymentMethodType === CONST.IOU.PAYMENT_TYPE.VBBA ? CONST.IOU.PAYMENT_SELECTED.BBA : CONST.IOU.PAYMENT_SELECTED.PBA;
completePaymentOnboarding(paymentSelected, introSelected);
completePaymentOnboarding(paymentSelected, introSelected, betas);

let params: PayInvoiceParams = {
reportID: invoiceReport?.reportID,
Expand Down
3 changes: 3 additions & 0 deletions src/libs/actions/Report/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4749,6 +4749,7 @@ type CompleteOnboardingProps = {
onboardingPurposeSelected?: OnboardingPurpose;
shouldWaitForRHPVariantInitialization?: boolean;
introSelected: OnyxEntry<IntroSelected>;
betas: OnyxEntry<Beta[]>;
};

async function completeOnboarding({
Expand All @@ -4768,6 +4769,7 @@ async function completeOnboarding({
onboardingPurposeSelected,
shouldWaitForRHPVariantInitialization = false,
introSelected,
betas,
}: CompleteOnboardingProps) {
const onboardingData = prepareOnboardingOnyxData({
introSelected,
Expand All @@ -4781,6 +4783,7 @@ async function completeOnboarding({
selectedInterestedFeatures,
isInvitedAccountant,
onboardingPurposeSelected,
betas,
});
if (!onboardingData) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
const [onboardingCompanySize] = useOnyx(ONYXKEYS.ONBOARDING_COMPANY_SIZE);
const [userReportedIntegration] = useOnyx(ONYXKEYS.ONBOARDING_USER_REPORTED_INTEGRATION);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID);
const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector});

Expand Down Expand Up @@ -224,6 +225,7 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
shouldSkipTestDriveModal: !!policyID && !adminsChatReportID,
shouldWaitForRHPVariantInitialization: isSidePanelReportSupported,
introSelected,
betas,
});

// Avoid creating new WS because onboardingPolicyID is cleared before unmounting
Expand Down Expand Up @@ -273,6 +275,7 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
introSelected,
isSelfTourViewed,
conciergeReportID,
betas,
]);

// Create items for enabled features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat
const [onboardingAdminsChatReportID] = useOnyx(ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID);
const [account] = useOnyx(ONYXKEYS.ACCOUNT);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const archivedReportsIdSet = useArchivedReportsIdSet();
const [loginList] = useOnyx(ONYXKEYS.LOGIN_LIST);
const [onboardingValues] = useOnyx(ONYXKEYS.NVP_ONBOARDING);
Expand Down Expand Up @@ -82,6 +83,7 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat
onboardingPolicyID,
shouldSkipTestDriveModal: !!onboardingPolicyID && !mergedAccountConciergeReportID,
introSelected,
betas,
});

setOnboardingAdminsChatReportID();
Expand All @@ -108,6 +110,7 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat
mergedAccountConciergeReportID,
conciergeChatReportID,
introSelected,
betas,
],
);

Expand Down
2 changes: 2 additions & 0 deletions src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function BaseOnboardingPurpose({shouldUseNativeStyles, shouldEnableMaxHeight, ro
const [personalDetailsForm] = useOnyx(ONYXKEYS.FORMS.ONBOARDING_PERSONAL_DETAILS_FORM);
const [onboardingCompanySize] = useOnyx(ONYXKEYS.ONBOARDING_COMPANY_SIZE);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const paddingHorizontal = onboardingIsMediumOrLargerScreenWidth ? styles.ph8 : styles.ph5;

const [customChoices = getEmptyArray<OnboardingPurpose>()] = useOnyx(ONYXKEYS.ONBOARDING_CUSTOM_CHOICES);
Expand Down Expand Up @@ -108,6 +109,7 @@ function BaseOnboardingPurpose({shouldUseNativeStyles, shouldEnableMaxHeight, ro
onboardingPolicyID,
companySize: onboardingCompanySize,
introSelected,
betas,
});

return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function BaseOnboardingWorkspaceInvite({shouldUseNativeStyles}: BaseOnboardingWo
const [onboardingAdminsChatReportID] = useOnyx(ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID);
const [onboardingPurposeSelected] = useOnyx(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const policy = usePolicy(onboardingPolicyID);
const {onboardingMessages} = useOnboardingMessages();
// We need to use isSmallScreenWidth, see navigateAfterOnboarding function comment
Expand Down Expand Up @@ -128,6 +129,7 @@ function BaseOnboardingWorkspaceInvite({shouldUseNativeStyles}: BaseOnboardingWo
isInvitedAccountant,
onboardingPurposeSelected,
introSelected,
betas,
});

setOnboardingAdminsChatReportID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function BaseOnboardingWorkspaceOptional({shouldUseNativeStyles}: BaseOnboarding
const archivedReportsIdSet = useArchivedReportsIdSet();
const {onboardingMessages} = useOnboardingMessages();
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const {isRestrictedPolicyCreation} = usePreferredPolicy();
// When we merge public email with work email, we now want to navigate to the
// concierge chat report of the new work email and not the last accessed report.
Expand Down Expand Up @@ -90,6 +91,7 @@ function BaseOnboardingWorkspaceOptional({shouldUseNativeStyles}: BaseOnboarding
onboardingPolicyID,
shouldSkipTestDriveModal: (!!onboardingPolicyID && !onboardingAdminsChatReportID) || onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.PERSONAL_SPEND,
introSelected,
betas,
});

setOnboardingAdminsChatReportID();
Expand Down Expand Up @@ -117,6 +119,7 @@ function BaseOnboardingWorkspaceOptional({shouldUseNativeStyles}: BaseOnboarding
mergedAccountConciergeReportID,
introSelected,
conciergeChatReportID,
betas,
]);

return (
Expand Down
2 changes: 2 additions & 0 deletions src/pages/OnboardingWorkspaces/BaseOnboardingWorkspaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function BaseOnboardingWorkspaces({route, shouldUseNativeStyles}: BaseOnboarding
const [loginList] = useOnyx(ONYXKEYS.LOGIN_LIST);
const [session] = useOnyx(ONYXKEYS.SESSION);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const archivedReportsIdSet = useArchivedReportsIdSet();

const isValidated = isCurrentUserValidated(loginList, session?.email);
Expand All @@ -76,6 +77,7 @@ function BaseOnboardingWorkspaces({route, shouldUseNativeStyles}: BaseOnboarding
shouldSkipTestDriveModal: !!(policy.automaticJoiningEnabled ? policy.policyID : undefined),
companySize: onboardingCompanySize,
introSelected,
betas,
});
setOnboardingAdminsChatReportID();
setOnboardingPolicyID(policy.policyID);
Expand Down
46 changes: 29 additions & 17 deletions tests/actions/IOUTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14716,30 +14716,42 @@ describe('actions/IOU', () => {
});

it('should not call completeOnboarding when introSelected is undefined', () => {
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, undefined);
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, undefined, [CONST.BETAS.ALL]);
expect(completeOnboardingSpy).not.toHaveBeenCalled();
});

it('should not call completeOnboarding when isInviteOnboardingComplete is true', () => {
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, {
choice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM,
inviteType: CONST.ONBOARDING_INVITE_TYPES.IOU,
isInviteOnboardingComplete: true,
});
completePaymentOnboarding(
CONST.PAYMENT_SELECTED.BBA,
{
choice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM,
inviteType: CONST.ONBOARDING_INVITE_TYPES.IOU,
isInviteOnboardingComplete: true,
},
[CONST.BETAS.ALL],
);
expect(completeOnboardingSpy).not.toHaveBeenCalled();
});

it('should not call completeOnboarding when choice is missing', () => {
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, {
inviteType: CONST.ONBOARDING_INVITE_TYPES.IOU,
});
completePaymentOnboarding(
CONST.PAYMENT_SELECTED.BBA,
{
inviteType: CONST.ONBOARDING_INVITE_TYPES.IOU,
},
[CONST.BETAS.ALL],
);
expect(completeOnboardingSpy).not.toHaveBeenCalled();
});

it('should not call completeOnboarding when inviteType is missing', () => {
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, {
choice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM,
});
completePaymentOnboarding(
CONST.PAYMENT_SELECTED.BBA,
{
choice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM,
},
[CONST.BETAS.ALL],
);
expect(completeOnboardingSpy).not.toHaveBeenCalled();
});

Expand All @@ -14749,7 +14761,7 @@ describe('actions/IOU', () => {
inviteType: CONST.ONBOARDING_INVITE_TYPES.IOU,
companySize: CONST.ONBOARDING_COMPANY_SIZE.MICRO,
};
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, introSelected);
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, introSelected, [CONST.BETAS.ALL]);

expect(completeOnboardingSpy).toHaveBeenCalledWith(
expect.objectContaining({
Expand All @@ -14769,7 +14781,7 @@ describe('actions/IOU', () => {
inviteType: CONST.ONBOARDING_INVITE_TYPES.INVOICE,
companySize: CONST.ONBOARDING_COMPANY_SIZE.SMALL,
};
completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected);
completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected, [CONST.BETAS.ALL]);

expect(completeOnboardingSpy).toHaveBeenCalledWith(
expect.objectContaining({
Expand All @@ -14788,7 +14800,7 @@ describe('actions/IOU', () => {
choice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM,
inviteType: CONST.ONBOARDING_INVITE_TYPES.INVOICE,
};
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, introSelected);
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, introSelected, [CONST.BETAS.ALL]);

expect(completeOnboardingSpy).toHaveBeenCalledWith(
expect.objectContaining({
Expand All @@ -14803,7 +14815,7 @@ describe('actions/IOU', () => {
choice: CONST.ONBOARDING_CHOICES.SUBMIT,
inviteType: CONST.ONBOARDING_INVITE_TYPES.IOU,
};
completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected);
completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected, [CONST.BETAS.ALL]);

expect(completeOnboardingSpy).toHaveBeenCalledWith(
expect.objectContaining({
Expand All @@ -14819,7 +14831,7 @@ describe('actions/IOU', () => {
inviteType: CONST.ONBOARDING_INVITE_TYPES.CHAT,
companySize: CONST.ONBOARDING_COMPANY_SIZE.MEDIUM,
};
completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected, 'adminsChatReport123', 'policyID456');
completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected, [CONST.BETAS.ALL], 'adminsChatReport123', 'policyID456');

expect(completeOnboardingSpy).toHaveBeenCalledWith(
expect.objectContaining({
Expand Down
2 changes: 2 additions & 0 deletions tests/actions/ReportTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,7 @@ describe('actions/Report', () => {
companySize: CONST.ONBOARDING_COMPANY_SIZE.MICRO,
userReportedIntegration: null,
introSelected: {choice: engagementChoice},
betas: [CONST.BETAS.ALL],
});

await waitForBatchedUpdates();
Expand Down Expand Up @@ -3521,6 +3522,7 @@ describe('actions/Report', () => {
companySize: CONST.ONBOARDING_COMPANY_SIZE.MICRO,
userReportedIntegration: null,
introSelected: {choice: engagementChoice},
betas: [CONST.BETAS.ALL],
});

await waitForBatchedUpdates();
Expand Down
Loading