@@ -117,6 +117,7 @@ import {
117117 isArchivedReport,
118118 isChatUsedForOnboarding,
119119 isClosedExpenseReportWithNoExpenses,
120+ isConciergeChatReport,
120121 isDeprecatedGroupDM,
121122 isHarvestCreatedExpenseReport,
122123 isMoneyRequestReportEligibleForMerge,
@@ -12789,7 +12790,7 @@ describe('ReportUtils', () => {
1278912790 };
1279012791
1279112792 // When we call getReportPreviewMessage
12792- const result = getReportPreviewMessage(report, reportAction, false, false, undefined, false, reportAction);
12793+ const result = getReportPreviewMessage(report, undefined, reportAction, false, false, undefined, false, reportAction);
1279312794
1279412795 // Then it should return the childReportName instead of "payer owes $0"
1279512796 expect(result).toBe('Expense Report 2025-01-15');
@@ -12809,7 +12810,7 @@ describe('ReportUtils', () => {
1280912810 };
1281012811
1281112812 // When we call getReportPreviewMessage
12812- const result = getReportPreviewMessage(report, reportAction, false, false, undefined, false, reportAction);
12813+ const result = getReportPreviewMessage(report, undefined, reportAction, false, false, undefined, false, reportAction);
1281312814
1281412815 // Then it should return the message from the report action (not the childReportName)
1281512816 expect(result).toBe('payer owes $100');
@@ -12825,11 +12826,56 @@ describe('ReportUtils', () => {
1282512826 };
1282612827
1282712828 // When we call getReportPreviewMessage with isCopyAction = true
12828- const result = getReportPreviewMessage(report, reportAction, false, false, undefined, false, reportAction, true);
12829+ const result = getReportPreviewMessage(report, undefined, reportAction, false, false, undefined, false, reportAction, true);
1282912830
1283012831 // Then it should return the childReportName instead of "payer owes $0"
1283112832 expect(result).toBe('Expense Report 2025-01-15');
1283212833 });
12834+
12835+ it('should pass conciergeReportID through to computeReportName when isCopyAction is true', async () => {
12836+ const report = LHNTestUtils.getFakeReport();
12837+ const reportAction: ReportAction = {
12838+ ...LHNTestUtils.getFakeReportAction(),
12839+ actionName: CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW,
12840+ childReportName: 'Expense Report',
12841+ childMoneyRequestCount: 0,
12842+ };
12843+
12844+ // When called with conciergeReportID undefined, the function should not throw
12845+ const result1 = getReportPreviewMessage(report, undefined, reportAction, false, false, undefined, false, reportAction, true);
12846+ expect(typeof result1).toBe('string');
12847+
12848+ // When called with a specific conciergeReportID, the function should not throw
12849+ const result2 = getReportPreviewMessage(report, '12345', reportAction, false, false, undefined, false, reportAction, true);
12850+ expect(typeof result2).toBe('string');
12851+ });
12852+ });
12853+
12854+ describe('isConciergeChatReport', () => {
12855+ it('should return false for null/undefined report', () => {
12856+ expect(isConciergeChatReport(null, '12345')).toBe(false);
12857+ expect(isConciergeChatReport(undefined, '12345')).toBe(false);
12858+ });
12859+
12860+ it('should return false when conciergeReportID is undefined', () => {
12861+ const report = LHNTestUtils.getFakeReport();
12862+ expect(isConciergeChatReport(report, undefined)).toBe(false);
12863+ });
12864+
12865+ it('should return true when report.reportID matches conciergeReportID', () => {
12866+ const report = LHNTestUtils.getFakeReport();
12867+ expect(isConciergeChatReport(report, report.reportID)).toBe(true);
12868+ });
12869+
12870+ it('should return false when report.reportID does not match conciergeReportID', () => {
12871+ const report = LHNTestUtils.getFakeReport();
12872+ expect(isConciergeChatReport(report, 'non-matching-id')).toBe(false);
12873+ });
12874+
12875+ it('should return false for empty string conciergeReportID', () => {
12876+ const report = LHNTestUtils.getFakeReport();
12877+ expect(isConciergeChatReport(report, '')).toBe(false);
12878+ });
1283312879 });
1283412880
1283512881 describe('getAvailableReportFields', () => {
0 commit comments