Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
169b6b2
Render the Concierge automatic distance rate change message
MelvinBot Sep 10, 2026
629eafe
Add generated translations for the Concierge distance rate keys and a…
MelvinBot Sep 10, 2026
79162b1
Apply revised Polyglot Parrot translations for the Concierge distance…
MelvinBot Sep 10, 2026
c182433
Drop the htmlEncode of policyName in the Concierge distance rate message
MelvinBot Sep 10, 2026
2815d3f
Encode policyName in the Concierge distance rate message
MelvinBot Sep 10, 2026
9d01b51
Match CONCIERGE_AUTO_MATCH_VENDOR: drop the getReportAlternateText br…
MelvinBot Sep 10, 2026
0c2ad35
Localize the distance unit in the Concierge auto-select rate message
MelvinBot Sep 10, 2026
e1cc6b2
Treat the Concierge auto-select rate message as plain text
MelvinBot Sep 10, 2026
51af483
Revert the distance unit localization in the Concierge rate message
MelvinBot Sep 10, 2026
a553870
Correct the stale HTML contract on the Concierge rate message helper
MelvinBot Sep 10, 2026
9bebf51
Trim the Concierge rate message helper docstring to a one-line summary
MelvinBot Sep 10, 2026
d51765c
Describe the automatic rate change per expense instead of naming one …
MelvinBot Sep 11, 2026
7730fef
Leave getForDistanceRequest and DISTANCE_MERCHANT untouched
MelvinBot Sep 14, 2026
0501341
Apply the Polyglot Parrot translations for conciergeAutoSelectedDista…
MelvinBot Sep 14, 2026
b06bdf1
Merge remote-tracking branch 'origin/main' into claude-conciergeAutoS…
MelvinBot Sep 14, 2026
fd60404
Fix the typecheck and ESLint failures after merging main
MelvinBot Sep 14, 2026
9dea87e
Drop the @context annotation for conciergeAutoSelectedDistanceRates
MelvinBot Sep 14, 2026
02030a7
Encode the Concierge distance rate message at its HTML sinks
MelvinBot Sep 14, 2026
6286dc6
Sort the Str import to satisfy oxfmt
MelvinBot Sep 14, 2026
902f31b
Let the distance merchant regex accept grouped and locale-formatted n…
MelvinBot Sep 15, 2026
344a796
Collapse the two expectedResult assignments onto one line for oxfmt
MelvinBot Sep 15, 2026
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
5 changes: 4 additions & 1 deletion src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,7 @@ const CONST = {
MERGED_WITH_CASH_TRANSACTION: 'MERGEDWITHCASHTRANSACTION',
MODIFIED_EXPENSE: 'MODIFIEDEXPENSE',
CONCIERGE_AUTO_MATCH_VENDOR: 'CONCIERGEAUTOMATCHVENDOR',
CONCIERGE_AUTO_SELECT_DISTANCE_RATE: 'CONCIERGEAUTOSELECTDISTANCERATE',
MOVED: 'MOVED',
MOVED_TRANSACTION: 'MOVEDTRANSACTION',
UNREPORTED_TRANSACTION: 'UNREPORTEDTRANSACTION',
Expand Down Expand Up @@ -5653,7 +5654,9 @@ const CONST = {
OTHER_INVISIBLE_CHARACTERS: /[\u3164\u115f\u1160\uffa0\u2800]/g,
SHORT_MENTION_HTML: /<mention-short>(.*?)<\/mention-short>/g,
REPORT_ID_FROM_PATH: /(?<!\/search)\/r\/(\d+)/,
DISTANCE_MERCHANT: /^[0-9.]+ \w+ @ (-|-\()?[^0-9.\s]{1,3} ?[0-9.]+\)? \/ \w+$/,
// The distance and the rate can carry a group separator (the backend formats them with one, e.g. "1,234.56 mi")
// or a locale decimal separator (e.g. "€0,67"), so both numbers accept "," as well as ".".
DISTANCE_MERCHANT: /^[0-9.,]+ \w+ @ (-|-\()?[^0-9.,\s]{1,3} ?[0-9.,]+\)? \/ \w+$/,
WHITESPACE: /\s+/g,

get EXPENSIFY_POLICY_DOMAIN_NAME() {
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,7 @@ const translations: TranslationDeepObject<typeof en> = {
prompt: 'Aktivieren Sie Tags im Workspace, um die Ausgabendetails zu bearbeiten oder den Tag aus dieser Ausgabe zu löschen.',
confirmText: 'Tag löschen',
},
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `Kilometersätze für den neuen Arbeitsbereich aktualisiert – ${policyName}`,
},
transactionMerge: {
listPage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1923,6 +1923,7 @@ const translations: TranslationDeepObject<typeof en> = {
whatIsHoldExplainDM: 'Η αναμονή είναι σαν να πατάτε «παύση» σε μία δαπάνη μέχρι να είστε έτοιμοι να τη στείλετε.',
holdIsLeftBehindDM: 'Οι δεσμευμένες δαπάνες δεν θα αποσταλούν μέχρι να καταργήσετε τη δέσμευση.',
unholdWhenReadyDM: 'Αποδεσμεύστε τις δαπάνες όταν είστε έτοιμοι να τις στείλετε.',
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `οι τιμές αποζημίωσης χιλιομέτρων ενημερώθηκαν για το νέο χώρο εργασίας - ${policyName}`,
},
transactionMerge: {
listPage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1919,6 +1919,7 @@ const translations = {
correctRateError: 'Fix the rate error and try again.',
AskToExplain: `. <a href="${CONST.CONCIERGE_EXPLAIN_LINK_PATH}">Explain<sparkles-icon/></a>`,
conciergeAutoMatchedVendor: ({vendorName}: {vendorName: string}) => `Concierge matched this expense to <strong>${vendorName}</strong>`,
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `distance rates updated for the new workspace - ${policyName}`,
rulesModifiedFields: {
reimbursable: (value: boolean) => (value ? 'marked the expense as "reimbursable"' : 'marked the expense as "non-reimbursable"'),
billable: (value: boolean) => (value ? 'marked the expense as "billable"' : 'marked the expense as "non-billable"'),
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,7 @@ const translations: TranslationDeepObject<typeof en> = {
prompt: 'Habilita las etiquetas en el espacio de trabajo para editar los detalles del gasto o eliminar la etiqueta de este gasto.',
confirmText: 'Eliminar etiqueta',
},
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `se han actualizado las tarifas de kilometraje para el nuevo espacio de trabajo: ${policyName}`,
},
transactionMerge: {
listPage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1879,6 +1879,7 @@ const translations: TranslationDeepObject<typeof en> = {
prompt: 'Active les tags dans l’espace de travail pour modifier les détails de la dépense ou supprimer le tag de cette dépense.',
confirmText: 'Supprimer le tag',
},
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `les taux kilométriques ont été mis à jour pour le nouvel espace de travail - ${policyName}`,
},
transactionMerge: {
listPage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,7 @@ const translations: TranslationDeepObject<typeof en> = {
prompt: 'Abilita le etichette nello spazio di lavoro per modificare i dettagli della spesa o eliminare l’etichetta da questa spesa.',
confirmText: 'Elimina tag',
},
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `tariffe chilometriche aggiornate per il nuovo spazio di lavoro - ${policyName}`,
},
transactionMerge: {
listPage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,7 @@ const translations: TranslationDeepObject<typeof en> = {
prompt: 'ワークスペースでタグを有効にすると、この経費の詳細を編集したり、この経費からタグを削除したりできます。',
confirmText: 'タグを削除',
},
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `新しいワークスペース「${policyName}」の距離単価を更新しました`,
},
transactionMerge: {
listPage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1865,6 +1865,7 @@ const translations: TranslationDeepObject<typeof en> = {
prompt: 'Schakel tags in op de werkruimte om de onkostendetails te bewerken of de tag uit deze onkosten te verwijderen.',
confirmText: 'Label verwijderen',
},
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `kilometervergoedingen bijgewerkt voor de nieuwe workspace - ${policyName}`,
},
transactionMerge: {
listPage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1900,6 +1900,7 @@ const translations: TranslationDeepObject<typeof en> = {
prompt: 'Włącz tagi w przestrzeni roboczej, aby edytować szczegóły wydatku lub usunąć ten tag z tego wydatku.',
confirmText: 'Usuń znacznik',
},
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `stawki za przejechany dystans zaktualizowane dla nowej przestrzeni roboczej – ${policyName}`,
},
transactionMerge: {
listPage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,7 @@ const translations: TranslationDeepObject<typeof en> = {
confirmText: 'Excluir categoria',
},
tagDisabledAlert: {title: 'Tag desativada', prompt: 'Ative as tags no workspace para editar os detalhes da despesa ou excluir a tag desta despesa.', confirmText: 'Excluir tag'},
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `taxas de distância atualizadas para o novo workspace - ${policyName}`,
},
transactionMerge: {
listPage: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,7 @@ const translations: TranslationDeepObject<typeof en> = {
deleteConfirmationSomePendingBYOC: '您确定要删除这些报销吗?其中一些处于待处理状态,如果入账后,我们可能会再次导入。',
categoryDisabledAlert: {title: '类别已禁用', prompt: '在工作区中启用类别,以编辑报销详情或从此报销中删除该类别。', confirmText: '删除类别'},
tagDisabledAlert: {title: '标签已停用', prompt: '请在工作区中启用标签,以便编辑该报销的详细信息或从此报销中删除该标签。', confirmText: '删除标签'},
conciergeAutoSelectedDistanceRates: ({policyName}: {policyName: string}) => `已为新工作区更新里程报销标准 - ${policyName}`,
},
transactionMerge: {
listPage: {
Expand Down
20 changes: 20 additions & 0 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2525,6 +2525,12 @@ function getReportActionMessageFragments(translate: LocalizedTranslate, action:
return [{text: message, html: `<muted-text>${message}</muted-text>`, type: 'COMMENT'}];
}

if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.CONCIERGE_AUTO_SELECT_DISTANCE_RATE)) {
const message = getConciergeAutoSelectDistanceRateMessage(translate, action);
// The helper returns plain text, so only the html fragment is encoded — a workspace name containing an entity like `&copy;` would otherwise be parsed as markup.
return [{text: message, html: `<muted-text>${Str.htmlEncode(message)}</muted-text>`, type: 'COMMENT'}];
}

if (isDynamicExternalWorkflowSubmitFailedAction(action)) {
const failedSubmitReason = getDynamicExternalWorkflowSubmitFailedActionMessage(translate, action);
return [{text: failedSubmitReason, html: `<muted-text>${failedSubmitReason}</muted-text>`, type: 'COMMENT'}];
Expand Down Expand Up @@ -3431,6 +3437,19 @@ function getWorkspaceCustomUnitRateUpdatedMessage(translate: LocalizedTranslate,
return getReportActionText(action);
}

/**
* Builds the Concierge system message explaining that the distance rates of a report's expenses were re-selected automatically.
*/
function getConciergeAutoSelectDistanceRateMessage(translate: LocalizedTranslate, action: ReportAction): string {
const policyName = isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.CONCIERGE_AUTO_SELECT_DISTANCE_RATE) ? getOriginalMessage(action)?.policyName : undefined;

if (!policyName) {
return getReportActionText(action);
}

return translate('iou.conciergeAutoSelectedDistanceRates', {policyName});
}

function getWorkspaceCustomUnitRateDeletedMessage(translate: LocalizedTranslate, action: ReportAction): string {
const {customUnitName, rateName} = getOriginalMessage(action as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.DELETE_CUSTOM_UNIT_RATE>) ?? {};
if (customUnitName && rateName) {
Expand Down Expand Up @@ -5064,6 +5083,7 @@ export {
getRemovedFromApprovalChainMessage,
getDemotedFromWorkspaceMessage,
getDynamicExternalWorkflowRoutedMessage,
getConciergeAutoSelectDistanceRateMessage,
getReportAction,
getReportActionHtml,
getReportActionMessage,
Expand Down
3 changes: 3 additions & 0 deletions src/libs/ReportAlternateTextUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import {
getCompanyAddressUpdateMessage,
getCompanyCardConnectionBroken30DaysMessage,
getCompanyCardConnectionBrokenMessage,
getConciergeAutoSelectDistanceRateMessage,
getCurrencyConversionFeeMessage,
getCurrencyDefaultTaxUpdateMessage,
getCustomTaxNameUpdateMessage,
Expand Down Expand Up @@ -763,6 +764,8 @@ function getLastMessageTextForReport({
lastMessageTextFromReport = Parser.htmlToText(getActionableMentionWhisperMessage(translate, lastReportAction, getPersonalDetailsListByIDs(targetAccountIDs, personalDetails)));
} else if (isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.DYNAMIC_EXTERNAL_WORKFLOW_ROUTED)) {
lastMessageTextFromReport = getDynamicExternalWorkflowRoutedMessage(lastReportAction, translate);
} else if (isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.CONCIERGE_AUTO_SELECT_DISTANCE_RATE)) {
lastMessageTextFromReport = getConciergeAutoSelectDistanceRateMessage(translate, lastReportAction);
}
if (isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT)) {
lastMessageTextFromReport = getPolicyChangeLogMaxExpenseAmountMessage(translate, lastReportAction, convertToDisplayString);
Expand Down
5 changes: 5 additions & 0 deletions src/libs/ReportNameUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {
getCompanyAddressUpdateMessage,
getCompanyCardConnectionBroken30DaysMessage,
getCompanyCardConnectionBrokenMessage,
getConciergeAutoSelectDistanceRateMessage,
getCreatedReportForUnapprovedTransactionsMessage,
getCrossBorderReimbursedMessage,
getCurrencyConversionFeeMessage,
Expand Down Expand Up @@ -892,6 +893,10 @@ function computeReportNameBasedOnReportAction({
return getTravelUpdateMessage(translate, parentReportAction);
}

if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.CONCIERGE_AUTO_SELECT_DISTANCE_RATE)) {
return getConciergeAutoSelectDistanceRateMessage(translate, parentReportAction);
}

if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_CUSTOM_UNIT_RATE)) {
return getWorkspaceCustomUnitRateAddedMessage(translate, dateFnsLocale, parentReportAction);
}
Expand Down
4 changes: 4 additions & 0 deletions src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
getCompanyAddressUpdateMessage,
getCompanyCardConnectionBroken30DaysMessage,
getCompanyCardConnectionBrokenMessage,
getConciergeAutoSelectDistanceRateMessage,
getCreatedReportForUnapprovedTransactionsMessage,
getCurrencyConversionFeeMessage,
getCurrencyDefaultTaxUpdateMessage,
Expand Down Expand Up @@ -1379,6 +1380,9 @@ const ContextMenuActions: ContextMenuAction[] = [
setClipboardMessage(getUpdatedCardFeedStatementPeriodMessage(translate, reportAction));
} else if (isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.TRAVEL_UPDATE)) {
setClipboardMessage(getTravelUpdateMessage(translate, reportAction));
} else if (isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.CONCIERGE_AUTO_SELECT_DISTANCE_RATE)) {
// setClipboardMessage treats its argument as HTML, and the helper returns plain text, so encode it to copy a workspace name containing an entity literally.
setClipboardMessage(Str.htmlEncode(getConciergeAutoSelectDistanceRateMessage(translate, reportAction)));
} else if (isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_AUDIT_RATE)) {
setClipboardMessage(getUpdatedAuditRateMessage(translate, reportAction));
} else if (isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_APPROVER_RULE)) {
Expand Down
10 changes: 10 additions & 0 deletions src/pages/inbox/report/actionContents/ActionContentRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
getCompanyCardConnectionBroken30DaysMessage,
getCommuterExclusionMessage,
getCompanyCardConnectionBrokenMessage,
getConciergeAutoSelectDistanceRateMessage,
getDelegateSubmitMessage,
getForwardedReportActionMessage,
getIOUReportIDFromReportActionPreview,
Expand Down Expand Up @@ -61,6 +62,7 @@ import type * as OnyxTypes from '@src/types/onyx';

import type {OnyxEntry} from 'react-native-onyx';

import {Str} from 'expensify-common';
import React from 'react';

import ApprovalFlowContent, {isApprovalFlowAction} from './ApprovalFlowContent';
Expand Down Expand Up @@ -360,6 +362,14 @@ function ActionContentRouter({
</ReportActionItemBasicMessage>
);
}
if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.CONCIERGE_AUTO_SELECT_DISTANCE_RATE)) {
return (
<ReportActionItemBasicMessage message="">
{/* The helper returns plain text, so encode it before it becomes HTML or a workspace name containing an entity like `&copy;` would be parsed as markup. */}
<RenderHTML html={`<comment><muted-text>${Str.htmlEncode(getConciergeAutoSelectDistanceRateMessage(translate, action))}</muted-text></comment>`} />
</ReportActionItemBasicMessage>
);
}
if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.TRAVEL_NUDGE)) {
return (
<ReportActionItemBasicMessage message="">
Expand Down
11 changes: 11 additions & 0 deletions src/types/onyx/OriginalMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,16 @@ type OriginalMessageConciergeAutoMatchVendor = {
reasoning?: string;
};

/**
* Model of `concierge auto select distance rate` report action — posted on an expense report when the report's workspace changes and the distance rates of its expenses are
* re-selected automatically. The individual rate changes are described by a `MODIFIED_EXPENSE` action on each expense's transaction thread, so this action names no rate itself:
* one report can hold many distance expenses, and each can end up on a different rate.
*/
type OriginalMessageConciergeAutoSelectDistanceRate = {
/** Name of the workspace the report was moved to, whose rates were applied */
policyName?: string;
};

/** Policy rules modified fields. Each member holds the new value the rule wrote, not the current one */
type PolicyRulesModifiedFields = {
merchant?: string;
Expand Down Expand Up @@ -1615,6 +1625,7 @@ type OriginalMessageMap = {
[CONST.REPORT.ACTIONS.TYPE.MERGED_WITH_CASH_TRANSACTION]: never;
[CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE]: OriginalMessageModifiedExpense;
[CONST.REPORT.ACTIONS.TYPE.CONCIERGE_AUTO_MATCH_VENDOR]: OriginalMessageConciergeAutoMatchVendor;
[CONST.REPORT.ACTIONS.TYPE.CONCIERGE_AUTO_SELECT_DISTANCE_RATE]: OriginalMessageConciergeAutoSelectDistanceRate;
[CONST.REPORT.ACTIONS.TYPE.MOVED]: OriginalMessageMoved;
[CONST.REPORT.ACTIONS.TYPE.MOVED_TRANSACTION]: OriginalMessageMovedTransaction;
[CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION]: OriginalMessageUnreportedTransaction;
Expand Down
64 changes: 64 additions & 0 deletions tests/unit/ModifiedExpenseMessageTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,70 @@ describe('ModifiedExpenseMessage', () => {
});
});

describe('when only the rate of a distance expense changes', () => {
const reportAction = {
...createRandomReportAction(1),
actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE,
originalMessage: {
merchant: '1,234.56 mi @ $0.70 / mi',
oldMerchant: '1,234.56 mi @ $0.67 / mi',
amount: 86419,
currency: CONST.CURRENCY.USD,
oldAmount: 82716,
oldCurrency: CONST.CURRENCY.USD,
},
};

// The backend groups the distance with a thousands separator, so the merchant only matches
// DISTANCE_MERCHANT once that separator is allowed. Without it the message wrongly says "distance".
it('says the rate changed even when the distance carries a thousands separator', () => {
const expectedResult = 'changed the rate to 1,234.56 mi @ $0.70 / mi (previously 1,234.56 mi @ $0.67 / mi), which updated the amount to $864.19 (previously $827.16)';

const result = getForReportAction({
convertToDisplayString,
translate: translateLocal,
reportAction,
policy: undefined,
policyTags: undefined,
currentUserAccountID: CURRENT_USER_ACCOUNT_ID,
currentUserLogin: CURRENT_USER_LOGIN,
});

expect(result).toEqual(expectedResult);
});
});

describe('when only the distance of a distance expense changes', () => {
const reportAction = {
...createRandomReportAction(1),
actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE,
originalMessage: {
merchant: '2,345.67 mi @ $0.67 / mi',
oldMerchant: '1,234.56 mi @ $0.67 / mi',
amount: 157159,
currency: CONST.CURRENCY.USD,
oldAmount: 82716,
oldCurrency: CONST.CURRENCY.USD,
},
};

it('says the distance changed', () => {
const expectedResult = 'changed the distance to 2,345.67 mi @ $0.67 / mi (previously 1,234.56 mi @ $0.67 / mi), which updated the amount to $1,571.59 (previously $827.16)';

const result = getForReportAction({
convertToDisplayString,
translate: translateLocal,
reportAction,
policy: undefined,
policyTags: undefined,
currentUserAccountID: CURRENT_USER_ACCOUNT_ID,
currentUserLogin: CURRENT_USER_LOGIN,
});

expect(result).toEqual(expectedResult);
});
});

describe('when the amount and merchant are changed', () => {
const reportAction = {
...createRandomReportAction(1),
Expand Down
Loading
Loading