@@ -572,13 +572,123 @@ describe('ReportUtils', () => {
572572 companySize: CONST.ONBOARDING_COMPANY_SIZE.MICRO,
573573 });
574574 expect(result?.guidedSetupData).toHaveLength(0);
575- // MICRO company size with suggestedFollowups beta adds a bespoke Concierge welcome action optimistically
575+ // suggestedFollowups beta adds a bespoke Concierge welcome action optimistically for all company sizes
576576 const reportActionsEntries = result?.optimisticData.filter((i) => i.key === `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${adminsChatReportID}`);
577577 expect(reportActionsEntries).toHaveLength(1);
578- expect(result?.bespokeWelcomeMessage).toBeDefined( );
578+ expect(result?.bespokeWelcomeMessage).toContain('For a small team like yours' );
579579 expect(result?.optimisticConciergeReportActionID).toBeDefined();
580580 });
581581
582+ it('should generate bespoke welcome message for SMALL company sizes with suggestedFollowups beta', async () => {
583+ const adminsChatReportID = '1';
584+ await Onyx.merge(ONYXKEYS.SESSION, {email: 'test@example.com'});
585+ await Onyx.merge(ONYXKEYS.BETAS, [CONST.BETAS.SUGGESTED_FOLLOWUPS]);
586+ await waitForBatchedUpdates();
587+
588+ const result = prepareOnboardingOnyxData({
589+ introSelected: undefined,
590+ engagementChoice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM,
591+ onboardingMessage: {
592+ message: 'This is a test',
593+ tasks: [{type: CONST.ONBOARDING_TASK_TYPE.CONNECT_CORPORATE_CARD, title: () => '', description: () => '', autoCompleted: false}],
594+ },
595+ adminsChatReportID,
596+ selectedInterestedFeatures: ['areCompanyCardsEnabled'],
597+ companySize: CONST.ONBOARDING_COMPANY_SIZE.SMALL,
598+ });
599+ expect(result?.guidedSetupData).toHaveLength(0);
600+ expect(result?.bespokeWelcomeMessage).toContain('growing team');
601+ expect(result?.optimisticConciergeReportActionID).toBeDefined();
602+ });
603+
604+ it('should generate bespoke welcome message for LARGE company sizes with suggestedFollowups beta', async () => {
605+ const adminsChatReportID = '1';
606+ await Onyx.merge(ONYXKEYS.SESSION, {email: 'test@example.com'});
607+ await Onyx.merge(ONYXKEYS.BETAS, [CONST.BETAS.SUGGESTED_FOLLOWUPS]);
608+ await waitForBatchedUpdates();
609+
610+ const result = prepareOnboardingOnyxData({
611+ introSelected: undefined,
612+ engagementChoice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM,
613+ onboardingMessage: {
614+ message: 'This is a test',
615+ tasks: [{type: CONST.ONBOARDING_TASK_TYPE.CONNECT_CORPORATE_CARD, title: () => '', description: () => '', autoCompleted: false}],
616+ },
617+ adminsChatReportID,
618+ selectedInterestedFeatures: ['areCompanyCardsEnabled'],
619+ companySize: CONST.ONBOARDING_COMPANY_SIZE.LARGE,
620+ });
621+ expect(result?.guidedSetupData).toHaveLength(0);
622+ expect(result?.bespokeWelcomeMessage).toContain('organization your size');
623+ expect(result?.optimisticConciergeReportActionID).toBeDefined();
624+ });
625+
626+ it('should generate bespoke welcome message for MEDIUM_SMALL company sizes with suggestedFollowups beta', async () => {
627+ const adminsChatReportID = '1';
628+ await Onyx.merge(ONYXKEYS.SESSION, {email: 'test@example.com'});
629+ await Onyx.merge(ONYXKEYS.BETAS, [CONST.BETAS.SUGGESTED_FOLLOWUPS]);
630+ await waitForBatchedUpdates();
631+
632+ const result = prepareOnboardingOnyxData({
633+ introSelected: undefined,
634+ engagementChoice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM,
635+ onboardingMessage: {
636+ message: 'This is a test',
637+ tasks: [{type: CONST.ONBOARDING_TASK_TYPE.CONNECT_CORPORATE_CARD, title: () => '', description: () => '', autoCompleted: false}],
638+ },
639+ adminsChatReportID,
640+ selectedInterestedFeatures: ['areCompanyCardsEnabled'],
641+ companySize: CONST.ONBOARDING_COMPANY_SIZE.MEDIUM_SMALL,
642+ });
643+ expect(result?.guidedSetupData).toHaveLength(0);
644+ expect(result?.bespokeWelcomeMessage).toContain('growing team');
645+ expect(result?.optimisticConciergeReportActionID).toBeDefined();
646+ });
647+
648+ it('should generate bespoke welcome message for MEDIUM company sizes with suggestedFollowups beta', async () => {
649+ const adminsChatReportID = '1';
650+ await Onyx.merge(ONYXKEYS.SESSION, {email: 'test@example.com'});
651+ await Onyx.merge(ONYXKEYS.BETAS, [CONST.BETAS.SUGGESTED_FOLLOWUPS]);
652+ await waitForBatchedUpdates();
653+
654+ const result = prepareOnboardingOnyxData({
655+ introSelected: undefined,
656+ engagementChoice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM,
657+ onboardingMessage: {
658+ message: 'This is a test',
659+ tasks: [{type: CONST.ONBOARDING_TASK_TYPE.CONNECT_CORPORATE_CARD, title: () => '', description: () => '', autoCompleted: false}],
660+ },
661+ adminsChatReportID,
662+ selectedInterestedFeatures: ['areCompanyCardsEnabled'],
663+ companySize: CONST.ONBOARDING_COMPANY_SIZE.MEDIUM,
664+ });
665+ expect(result?.guidedSetupData).toHaveLength(0);
666+ expect(result?.bespokeWelcomeMessage).toContain('organization your size');
667+ expect(result?.optimisticConciergeReportActionID).toBeDefined();
668+ });
669+
670+ it('should append accounting integration suffix to bespoke welcome message', async () => {
671+ const adminsChatReportID = '1';
672+ await Onyx.merge(ONYXKEYS.SESSION, {email: 'test@example.com'});
673+ await Onyx.merge(ONYXKEYS.BETAS, [CONST.BETAS.SUGGESTED_FOLLOWUPS]);
674+ await waitForBatchedUpdates();
675+
676+ const result = prepareOnboardingOnyxData({
677+ introSelected: undefined,
678+ engagementChoice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM,
679+ onboardingMessage: {
680+ message: 'This is a test',
681+ tasks: [{type: CONST.ONBOARDING_TASK_TYPE.CONNECT_CORPORATE_CARD, title: () => '', description: () => '', autoCompleted: false}],
682+ },
683+ adminsChatReportID,
684+ selectedInterestedFeatures: ['areCompanyCardsEnabled'],
685+ companySize: CONST.ONBOARDING_COMPANY_SIZE.SMALL,
686+ userReportedIntegration: 'quickbooksOnline',
687+ });
688+ expect(result?.bespokeWelcomeMessage).toContain('QuickBooks Online');
689+ expect(result?.bespokeWelcomeMessage).toContain('expenses sync automatically');
690+ });
691+
582692 it('should add guidedSetupData when posting into admin room WITHOUT suggestedFollowups beta', async () => {
583693 const adminsChatReportID = '1';
584694 // Not having `+` in the email allows for `isPostingTasksInAdminsRoom` flow
0 commit comments