@@ -5,9 +5,9 @@ let buildURL = require('../src/buildURL');
55
66describe ( "test building url methods" , ( ) => {
77
8- let expected_search_url = "http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=testID&OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&RESPONSE-DATA-FORMAT=JSON&REST-PAYLOAD&keywords=iphone&paginationInput.entriesPerPage=6&GLOBAL-ID=EBAY-US"
9- it ( "test search url" , ( ) => {
108
9+ it ( "test search url" , ( ) => {
10+ let expected_search_url = "http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=testID&OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&RESPONSE-DATA-FORMAT=JSON&REST-PAYLOAD&keywords=iphone&paginationInput.entriesPerPage=6&GLOBAL-ID=EBAY-US"
1111 let options = {
1212 name : "iphone" ,
1313 operationName : "findItemsByKeywords" ,
@@ -18,4 +18,27 @@ describe("test building url methods", () => {
1818 }
1919 expect ( buildURL . buildSearchUrl ( options ) ) . to . be . equal ( expected_search_url ) ;
2020 } ) ;
21+
22+ it ( "test Shopping url without selector" , ( ) => {
23+ let expected_search_url = "http://open.api.ebay.com/Shopping?appid=testID&callname=demoShoppingName&version=967&siteid=0&responseencoding=JSON&keywords=iphone"
24+ let options = {
25+ name : "iphone" ,
26+ operationName : "demoShoppingName" ,
27+ param : "keywords" ,
28+ clientID : "testID" ,
29+ }
30+ expect ( buildURL . buildShoppingUrl ( options ) ) . to . be . equal ( expected_search_url ) ;
31+ } ) ;
32+
33+ it ( "test Shopping url including selector" , ( ) => {
34+ let expected_search_url = "http://open.api.ebay.com/Shopping?appid=testID&callname=demoShoppingName&version=967&siteid=0&responseencoding=JSON&keywords=iphone&IncludeSelector=true"
35+ let options = {
36+ name : "iphone" ,
37+ operationName : "demoShoppingName" ,
38+ param : "keywords" ,
39+ clientID : "testID" ,
40+ includeSelector : true
41+ }
42+ expect ( buildURL . buildShoppingUrl ( options ) ) . to . be . equal ( expected_search_url ) ;
43+ } ) ;
2144} ) ;
0 commit comments