@@ -3,6 +3,8 @@ import { assert } from 'chai'
3
3
import { formatPaymentInfo } from '../../src/services/basePayId'
4
4
import { AddressDetailsType } from '../../src/types/protocol'
5
5
6
+ const version1dot1 = '1.1'
7
+
6
8
describe ( 'Base PayID - formatPaymentInfo()' , function ( ) : void {
7
9
it ( 'Returns CryptoAddressDetails & FiatAddressDetails for addressDetailsTypes when formatting array with multiple AddressInformation' , function ( ) {
8
10
// GIVEN an array of AddressInformation with an ACH entry
@@ -48,7 +50,7 @@ describe('Base PayID - formatPaymentInfo()', function (): void {
48
50
}
49
51
50
52
// WHEN we format it
51
- const paymentInfo = formatPaymentInfo ( addressInfo , payId )
53
+ const paymentInfo = formatPaymentInfo ( addressInfo , version1dot1 , payId )
52
54
53
55
// THEN we get back a PaymentInformation object with the appropriate address details
54
56
assert . deepStrictEqual ( paymentInfo , expectedPaymentInfo )
@@ -80,7 +82,7 @@ describe('Base PayID - formatPaymentInfo()', function (): void {
80
82
}
81
83
82
84
// WHEN we format it and don't pass in a PayID
83
- const paymentInfo = formatPaymentInfo ( addressInfo )
85
+ const paymentInfo = formatPaymentInfo ( addressInfo , version1dot1 )
84
86
85
87
// THEN we get back a PaymentInformation object without a PayID
86
88
assert . deepStrictEqual ( paymentInfo , expectedPaymentInfo )
@@ -114,7 +116,7 @@ describe('Base PayID - formatPaymentInfo()', function (): void {
114
116
}
115
117
116
118
// WHEN we format it
117
- const paymentInfo = formatPaymentInfo ( addressInfo )
119
+ const paymentInfo = formatPaymentInfo ( addressInfo , version1dot1 )
118
120
119
121
// THEN we get back a PaymentInformation object with no environment
120
122
assert . deepStrictEqual ( paymentInfo , expectedPaymentInfo )
@@ -153,7 +155,12 @@ describe('Base PayID - formatPaymentInfo()', function (): void {
153
155
const memoFn = ( ) : string => 'memo'
154
156
155
157
// WHEN we format the address information
156
- const paymentInfo = formatPaymentInfo ( addressInfo , payId , memoFn )
158
+ const paymentInfo = formatPaymentInfo (
159
+ addressInfo ,
160
+ version1dot1 ,
161
+ payId ,
162
+ memoFn ,
163
+ )
157
164
158
165
// THEN we get back a PaymentInformation object with a memo
159
166
assert . deepStrictEqual ( paymentInfo , expectedPaymentInfo )
0 commit comments