@@ -217,6 +217,7 @@ describe('#AirParser', () => {
217
217
expect ( priceInfo ) . to . be . an ( 'object' ) ;
218
218
expect ( priceInfo ) . to . have . all . keys ( [
219
219
'totalPrice' , 'basePrice' , 'taxes' , 'taxesInfo' , 'equivalentBasePrice' ,
220
+ 'noAdc' ,
220
221
] ) ;
221
222
expect ( priceInfo . totalPrice ) . to . match ( / [ A - Z ] { 3 } (?: \d + \. ) ? \d + / i) ;
222
223
expect ( priceInfo . basePrice ) . to . match ( / [ A - Z ] { 3 } (?: \d + \. ) ? \d + / i) ;
@@ -263,6 +264,23 @@ describe('#AirParser', () => {
263
264
} ) ;
264
265
}
265
266
267
+ it ( 'should parse NO ADC ticket' , ( ) => {
268
+ const uParser = new ParserUapi ( 'air:AirRetrieveDocumentRsp' , 'v39_0' , { } ) ;
269
+ const parseFunction = airParser . AIR_GET_TICKET ;
270
+ const xml = fs . readFileSync ( `${ xmlFolder } /getTicket_NOADC.xml` ) . toString ( ) ;
271
+
272
+ return uParser . parse ( xml )
273
+ . then ( json => parseFunction . call ( uParser , json ) )
274
+ . then ( ( result ) => {
275
+ expect ( result ) . to . be . an ( 'object' ) ;
276
+ expect ( result ) . to . include . key ( 'priceInfo' ) ;
277
+ expect ( result . priceInfoDetailsAvailable ) . to . equal ( false ) ;
278
+ expect ( result . priceInfo ) . to . be . an ( 'object' ) ;
279
+ expect ( result . priceInfo . noAdc ) . to . equal ( true ) ;
280
+ expect ( result . priceInfo . totalPrice ) . to . equal ( 0 ) ;
281
+ } ) ;
282
+ } ) ;
283
+
266
284
it ( 'should return correct error for duplicate ticket number' , ( ) => {
267
285
const uParser = new ParserUapi ( 'air:AirRetrieveDocumentRsp' , 'v39_0' , { } ) ;
268
286
const parseFunction = airParser . AIR_GET_TICKET ;
@@ -362,6 +380,7 @@ describe('#AirParser', () => {
362
380
expect ( priceInfo ) . to . be . an ( 'object' ) ;
363
381
expect ( priceInfo ) . to . have . all . keys ( [
364
382
'totalPrice' , 'basePrice' , 'taxes' , 'equivalentBasePrice' , 'taxesInfo' ,
383
+ 'noAdc' ,
365
384
] ) ;
366
385
expect ( priceInfo . totalPrice ) . to . match ( / [ A - Z ] { 3 } (?: \d + \. ) ? \d + / i) ;
367
386
expect ( priceInfo . basePrice ) . to . match ( / [ A - Z ] { 3 } (?: \d + \. ) ? \d + / i) ;
0 commit comments