@@ -121,6 +121,41 @@ suite('client-checkout-giftcards-integration-test', () => {
121
121
implementsNode : false
122
122
}
123
123
} ) ;
124
+
125
+ assert . ok ( updatedCheckout . lineItemsSubtotalPrice , 'lineItemsSubtotalPrice exists' ) ;
126
+ assert . strictEqual ( updatedCheckout . lineItemsSubtotalPrice . amount , '70.0' , 'lineItemsSubtotalPrice amount is correct' ) ;
127
+ assert . strictEqual ( updatedCheckout . lineItemsSubtotalPrice . currencyCode , 'CAD' , 'lineItemsSubtotalPrice currencyCode is correct' ) ;
128
+
129
+ assert . ok ( updatedCheckout . subtotalPrice , 'subtotalPrice exists' ) ;
130
+ assert . ok ( updatedCheckout . subtotalPriceV2 , 'subtotalPriceV2 exists' ) ;
131
+ assert . strictEqual ( updatedCheckout . subtotalPrice , updatedCheckout . subtotalPriceV2 ) ;
132
+ assert . strictEqual ( updatedCheckout . subtotalPrice . amount , '70.0' , 'subtotalPrice does not include gift cards' ) ;
133
+ assert . strictEqual ( updatedCheckout . subtotalPrice . currencyCode , 'CAD' , 'subtotalPrice currency is correct' ) ;
134
+
135
+ assert . ok ( updatedCheckout . totalPrice , 'totalPrice exists' ) ;
136
+ assert . ok ( updatedCheckout . totalPriceV2 , 'totalPriceV2 exists' ) ;
137
+ assert . strictEqual ( updatedCheckout . totalPrice , updatedCheckout . totalPriceV2 ) ;
138
+ assert . strictEqual ( updatedCheckout . totalPrice . amount , '70.0' , 'totalPrice does not include gift cards' ) ;
139
+ assert . strictEqual ( updatedCheckout . totalPrice . currencyCode , 'CAD' , 'totalPrice currency is correct' ) ;
140
+
141
+ assert . ok ( updatedCheckout . totalTax , 'totalTax exists' ) ;
142
+ assert . ok ( updatedCheckout . totalTaxV2 , 'totalTaxV2 exists' ) ;
143
+
144
+ assert . ok ( updatedCheckout . paymentDue , 'paymentDue exists' ) ;
145
+ assert . ok ( updatedCheckout . paymentDueV2 , 'paymentDueV2 exists' ) ;
146
+ assert . strictEqual ( updatedCheckout . paymentDue , updatedCheckout . paymentDueV2 ) ;
147
+ assert . strictEqual ( updatedCheckout . paymentDue . amount , '0.0' , 'paymentDue amount includes gift cards' ) ;
148
+ assert . strictEqual ( updatedCheckout . paymentDue . currencyCode , 'CAD' , 'paymentDue currencyCode is correct' ) ;
149
+
150
+ // Verify UNSUPPORTED_FIELDS maintain expected values
151
+ assert . strictEqual ( updatedCheckout . completedAt , null , 'completedAt is null' ) ;
152
+ assert . strictEqual ( updatedCheckout . order , null , 'order is null' ) ;
153
+ assert . strictEqual ( updatedCheckout . orderStatusUrl , null , 'orderStatusUrl is null' ) ;
154
+ assert . strictEqual ( updatedCheckout . ready , false , 'ready is false' ) ;
155
+ assert . strictEqual ( updatedCheckout . requiresShipping , true , 'requiresShipping is true' ) ;
156
+ assert . strictEqual ( updatedCheckout . shippingLine , null , 'shippingLine is null' ) ;
157
+ assert . strictEqual ( updatedCheckout . taxExempt , false , 'taxExempt is false' ) ;
158
+ assert . strictEqual ( updatedCheckout . taxesIncluded , false , 'taxesIncluded is false' ) ;
124
159
} ) ;
125
160
} ) ;
126
161
} ) ;
@@ -165,6 +200,32 @@ suite('client-checkout-giftcards-integration-test', () => {
165
200
assert . ok ( updatedCheckout . appliedGiftCards [ 1 ] . id ) ;
166
201
assert . strictEqual ( updatedCheckout . appliedGiftCards [ 1 ] . lastCharacters , 'card' ) ;
167
202
assert . ok ( updatedCheckout . appliedGiftCards [ 1 ] . type ) ;
203
+
204
+
205
+ assert . ok ( updatedCheckout . lineItemsSubtotalPrice , 'lineItemsSubtotalPrice exists' ) ;
206
+ assert . strictEqual ( updatedCheckout . lineItemsSubtotalPrice . amount , '270.0' , 'lineItemsSubtotalPrice does not include gift cards' ) ;
207
+ assert . strictEqual ( updatedCheckout . lineItemsSubtotalPrice . currencyCode , 'CAD' , 'lineItemsSubtotalPrice currencyCode is correct' ) ;
208
+
209
+ assert . ok ( updatedCheckout . subtotalPrice , 'subtotalPrice exists' ) ;
210
+ assert . ok ( updatedCheckout . subtotalPriceV2 , 'subtotalPriceV2 exists' ) ;
211
+ assert . strictEqual ( updatedCheckout . subtotalPrice , updatedCheckout . subtotalPriceV2 ) ;
212
+ assert . strictEqual ( updatedCheckout . subtotalPrice . amount , '270.0' , 'subtotalPrice does not include gift cards' ) ;
213
+ assert . strictEqual ( updatedCheckout . subtotalPrice . currencyCode , 'CAD' , 'subtotalPrice currency is correct' ) ;
214
+
215
+ assert . ok ( updatedCheckout . totalPrice , 'totalPrice exists' ) ;
216
+ assert . ok ( updatedCheckout . totalPriceV2 , 'totalPriceV2 exists' ) ;
217
+ assert . strictEqual ( updatedCheckout . totalPrice , updatedCheckout . totalPriceV2 ) ;
218
+ assert . strictEqual ( updatedCheckout . totalPrice . amount , '270.0' , 'totalPrice does not include gift cards' ) ;
219
+ assert . strictEqual ( updatedCheckout . totalPrice . currencyCode , 'CAD' , 'totalPrice currency is correct' ) ;
220
+
221
+ assert . ok ( updatedCheckout . paymentDue , 'paymentDue exists' ) ;
222
+ assert . ok ( updatedCheckout . paymentDueV2 , 'paymentDueV2 exists' ) ;
223
+ assert . strictEqual ( updatedCheckout . paymentDue , updatedCheckout . paymentDueV2 ) ;
224
+ assert . strictEqual ( updatedCheckout . paymentDue . amount , '120.0' , 'paymentDue amount includes gift cards' ) ;
225
+ assert . strictEqual ( updatedCheckout . paymentDue . currencyCode , 'CAD' , 'paymentDue currencyCode is correct' ) ;
226
+
227
+ assert . ok ( updatedCheckout . totalTax , 'totalTax exists' ) ;
228
+ assert . ok ( updatedCheckout . totalTaxV2 , 'totalTaxV2 exists' ) ;
168
229
} ) ;
169
230
} ) ;
170
231
} ) ;
0 commit comments