11import Onyx from 'react-native-onyx' ;
2+ import { convertToDisplayString } from '@libs/CurrencyUtils' ;
23import {
34 areTransactionsEligibleForMerge ,
45 buildMergedTransactionData ,
@@ -825,7 +826,7 @@ describe('MergeTransactionUtils', () => {
825826 } ;
826827
827828 // When we get display value for merchant
828- const result = getDisplayValue ( 'merchant' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
829+ const result = getDisplayValue ( 'merchant' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
829830
830831 // Then it should return empty string
831832 expect ( result ) . toBe ( '' ) ;
@@ -840,8 +841,8 @@ describe('MergeTransactionUtils', () => {
840841 } ;
841842
842843 // When we get display values for boolean fields
843- const reimbursableResult = getDisplayValue ( 'reimbursable' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
844- const billableResult = getDisplayValue ( 'billable' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
844+ const reimbursableResult = getDisplayValue ( 'reimbursable' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
845+ const billableResult = getDisplayValue ( 'billable' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
845846
846847 // Then it should return translated Yes/No values
847848 expect ( reimbursableResult ) . toBe ( 'common.yes' ) ;
@@ -857,7 +858,7 @@ describe('MergeTransactionUtils', () => {
857858 } ;
858859
859860 // When we get display value for amount
860- const result = getDisplayValue ( 'amount' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
861+ const result = getDisplayValue ( 'amount' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
861862
862863 // Then it should return formatted currency string
863864 expect ( result ) . toBe ( '$10.00' ) ;
@@ -873,7 +874,7 @@ describe('MergeTransactionUtils', () => {
873874 } ;
874875
875876 // When we get display value for description
876- const result = getDisplayValue ( 'description' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
877+ const result = getDisplayValue ( 'description' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
877878
878879 // Then it should return cleaned text without HTML and with spaces instead of line breaks
879880 expect ( result ) . toBe ( 'This is a test description with line breaks and more text' ) ;
@@ -887,7 +888,7 @@ describe('MergeTransactionUtils', () => {
887888 } ;
888889
889890 // When we get display value for tag
890- const result = getDisplayValue ( 'tag' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
891+ const result = getDisplayValue ( 'tag' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
891892
892893 // Then it should return sanitized tag names separated by commas
893894 expect ( result ) . toBe ( 'Department, Engineering, Frontend' ) ;
@@ -904,7 +905,7 @@ describe('MergeTransactionUtils', () => {
904905 ] ,
905906 } ,
906907 } ;
907- const result = getDisplayValue ( 'attendees' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
908+ const result = getDisplayValue ( 'attendees' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
908909
909910 expect ( result ) . toBe ( 'Test User 1, Test User 2' ) ;
910911 } ) ;
@@ -919,8 +920,8 @@ describe('MergeTransactionUtils', () => {
919920 } ;
920921
921922 // When we get display values for string fields
922- const merchantResult = getDisplayValue ( 'merchant' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
923- const categoryResult = getDisplayValue ( 'category' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
923+ const merchantResult = getDisplayValue ( 'merchant' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
924+ const categoryResult = getDisplayValue ( 'category' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
924925
925926 // Then it should return the string values
926927 expect ( merchantResult ) . toBe ( 'Starbucks Coffee' ) ;
@@ -935,7 +936,7 @@ describe('MergeTransactionUtils', () => {
935936 } ;
936937
937938 // When we get display value for reportID
938- const result = getDisplayValue ( 'reportID' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
939+ const result = getDisplayValue ( 'reportID' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
939940
940941 // Then it should return translated "None"
941942 expect ( result ) . toBe ( 'common.none' ) ;
@@ -950,7 +951,7 @@ describe('MergeTransactionUtils', () => {
950951 } ;
951952
952953 // When we get display value for reportID
953- const result = getDisplayValue ( 'reportID' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
954+ const result = getDisplayValue ( 'reportID' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
954955
955956 // Then it should return the reportName
956957 expect ( result ) . toBe ( 'Test Report Name' ) ;
@@ -976,7 +977,7 @@ describe('MergeTransactionUtils', () => {
976977 } ;
977978
978979 // When we get display value for reportID
979- const result = getDisplayValue ( 'reportID' , transaction , undefined , translateLocal , mockLocaleCompare ) ;
980+ const result = getDisplayValue ( 'reportID' , transaction , undefined , translateLocal , convertToDisplayString , mockLocaleCompare ) ;
980981
981982 // Then it should return the report's name from Onyx
982983 expect ( result ) . toBe ( report . reportName ) ;
0 commit comments