@@ -119,9 +119,17 @@ describe('OrdersService', () => {
119119 return ordersService . get ( orderId ) . then ( ( actualOrder ) => {
120120 expect ( actualOrder . lineItems . length ) . to . equal ( 1 ) ;
121121 if ( typeof actualOrder . fulfillments === 'undefined' ) {
122- throw new Error ( 'fulfillments length should be 0 ' ) ;
122+ throw new Error ( 'fulfillments length should be 1 ' ) ;
123123 }
124124 expect ( actualOrder . fulfillments . length ) . to . equal ( 1 ) ;
125+
126+ const fulfillment1 = actualOrder . fulfillments [ 0 ] ;
127+ if ( typeof fulfillment1 . trackingUrls === 'undefined' ) {
128+ throw new Error ( 'tracking urls for fulfillment 1 length should be 1' ) ;
129+ }
130+ expect ( fulfillment1 . trackingUrls . length ) . to . equal ( 2 ) ;
131+ expect ( fulfillment1 . trackingUrls ) . to . contain ( 'https://ups1.com/tracking-url1' ) ;
132+ expect ( fulfillment1 . trackingUrls ) . to . contain ( 'https://ups1.com/tracking-url2' ) ;
125133 expect ( clientGetStub . args [ 0 ] [ 0 ] ) . to . equal ( `/${ Version . V1 } ${ Resource . ORDERS } /${ orderId } ` ) ;
126134 } ) ;
127135 } ) ;
@@ -143,6 +151,14 @@ describe('OrdersService', () => {
143151 expect ( actualOrder . fulfillments . length ) . to . equal ( 1 ) ;
144152 expect ( actualOrder . fulfillments [ 0 ] . lineItems . length ) . to . equal ( 6 ) ;
145153 expect ( actualOrder . fulfillments [ 0 ] . lineItems [ 0 ] . price ) . to . equal ( 15.91 ) ;
154+
155+ const fulfillment1 = actualOrder . fulfillments [ 0 ] ;
156+ if ( typeof fulfillment1 . trackingUrls === 'undefined' ) {
157+ throw new Error ( 'tracking urls for fulfillment 1 length should be 1' ) ;
158+ }
159+ expect ( fulfillment1 . trackingUrls . length ) . to . equal ( 2 ) ;
160+ expect ( fulfillment1 . trackingUrls ) . to . contain ( 'https://ups1.com/tracking-url1' ) ;
161+ expect ( fulfillment1 . trackingUrls ) . to . contain ( 'https://ups1.com/tracking-url2' ) ;
146162 expect ( clientGetStub . args [ 0 ] [ 0 ] ) . to . equal ( `/${ Version . V1 } ${ Resource . ORDERS } /${ orderId } ` ) ;
147163 } ) ;
148164 } ) ;
0 commit comments