Skip to content

Commit

Permalink
Merge pull request #55735 from software-mansion-labs/fix/trip-hide-sp…
Browse files Browse the repository at this point in the history
…lit-expenses

Hide Split Expense from trip rooms
  • Loading branch information
stitesExpensify authored Jan 27, 2025
2 parents c4c860b + 7d05620 commit 9468d26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7316,8 +7316,8 @@ function isGroupChatAdmin(report: OnyxEntry<Report>, accountID: number) {
* as a participant of the report.
*/
function getMoneyRequestOptions(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>, reportParticipants: number[], filterDeprecatedTypes = false): IOUType[] {
// In any thread or task report, we do not allow any new expenses yet
if (isChatThread(report) || isTaskReport(report) || isInvoiceReport(report) || isSystemChat(report) || isArchivedReportWithID(report?.reportID)) {
// In any thread, task report or trip room, we do not allow any new expenses
if (isChatThread(report) || isTaskReport(report) || isInvoiceReport(report) || isSystemChat(report) || isArchivedReportWithID(report?.reportID) || isTripRoom(report)) {
return [];
}

Expand Down
10 changes: 10 additions & 0 deletions tests/unit/ReportUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,16 @@ describe('ReportUtils', () => {
expect(moneyRequestOptions.length).toBe(0);
});

it('its trip room', () => {
const report = {
...LHNTestUtils.getFakeReport(),
type: CONST.REPORT.TYPE.CHAT,
chatType: CONST.REPORT.CHAT_TYPE.TRIP_ROOM,
};
const moneyRequestOptions = temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID]);
expect(moneyRequestOptions.length).toBe(0);
});

it('its paid Expense report', () => {
const report = {
...LHNTestUtils.getFakeReport(),
Expand Down

0 comments on commit 9468d26

Please sign in to comment.