@@ -68,68 +68,6 @@ describe('Utility functions work properly', () => {
68
68
} ) ;
69
69
70
70
describe ( 'Utility functions work properly' , ( ) => {
71
- test ( 'getChannels should return a stringified array with commas' , ( ) => {
72
- let testChannels : PaymentChannels [ ] = [ 'card' , 'bank' ] ;
73
- let expectedOutput = 'channels: ["card","bank"],' ;
74
-
75
- const result = getChannels ( testChannels ) ;
76
- expect ( result ) . toBe ( expectedOutput ) ;
77
- } ) ;
78
-
79
- test ( 'toAmountInKobo should return kobo value for amount' , ( ) => {
80
- let result = toAmountInKobo ( '4600.00' ) ;
81
- expect ( result ) . toBe ( 460000 ) ;
82
-
83
- result = toAmountInKobo ( 1200.93 ) ;
84
- expect ( result ) . toBe ( 120093 ) ;
85
- } ) ;
86
-
87
- test ( 'getAmountValueInKobo should return kobo value for valid amounts' , ( ) => {
88
- let result = getAmountValueInKobo ( '4600.00' ) ;
89
- expect ( result ) . toBe ( 460000 ) ;
90
-
91
- result = getAmountValueInKobo ( 'not_correct_money_amount' ) ;
92
- expect ( result ) . toBe ( 0 ) ;
93
- } ) ;
94
-
95
- test ( 'isValidDecimalMonetaryValue should return true for only valid amount' , ( ) => {
96
- let result = isValidDecimalMonetaryValue ( '2500.00' ) ;
97
- expect ( result ) . toBe ( true ) ;
98
-
99
- result = isValidDecimalMonetaryValue ( '2500' ) ;
100
- expect ( result ) . toBe ( true ) ;
101
-
102
- result = isValidDecimalMonetaryValue ( 'invalid_amount' ) ;
103
- expect ( result ) . toBe ( false ) ;
104
- } ) ;
105
-
106
- test ( 'isValidStringAmount should return true for valid amount strings' , ( ) => {
107
- let result = isValidStringAmount ( '2500.00' ) ;
108
- expect ( result ) . toBe ( true ) ;
109
-
110
- result = isValidStringAmount ( 'not_money_amount' ) ;
111
- expect ( result ) . toBe ( false ) ;
112
-
113
- result = isValidStringAmount ( '2500.' ) ;
114
- expect ( result ) . toBe ( false ) ;
115
- } ) ;
116
-
117
- test ( 'toNumber should convert string amount to number' , ( ) => {
118
- const result = toNumber ( '2500.00' ) ;
119
- expect ( result ) . toBe ( 2500 ) ;
120
- } ) ;
121
-
122
- test ( 'isNegative should return true if amount is negative' , ( ) => {
123
- let result = isNegative ( '-200.00' ) ;
124
- expect ( result ) . toBe ( true ) ;
125
-
126
- result = isNegative ( - 200.0 ) ;
127
- expect ( result ) . toBe ( true ) ;
128
-
129
- result = isNegative ( 200.0 ) ;
130
- expect ( result ) . toBe ( false ) ;
131
- } ) ;
132
-
133
71
test ( 'buildKeyValueString should return correct string for key-value' , ( ) => {
134
72
let result = buildKeyValueString ( 'key1' , 'value1' ) ;
135
73
expect ( result ) . toBe ( "key1: 'value1'," ) ;
0 commit comments