diff options
| author | Rene Ae <aehtyb@gmail.com> | 2015-11-10 23:28:47 -0600 |
|---|---|---|
| committer | Rene Ae <aehtyb@gmail.com> | 2015-11-10 23:29:15 -0600 |
| commit | f513061a84becab81db06c37c71a99b986cda633 (patch) | |
| tree | 9b1c1504b28f56ac361855b792dc6239bace6c3f /test | |
| parent | e916bc00c47f1d39f3f71c6d6c1a93be730175ed (diff) | |
added more tests
Diffstat (limited to 'test')
| -rw-r--r-- | test/test/00-setup.js | 2 | ||||
| -rw-r--r-- | test/test/04-cart.js | 58 |
2 files changed, 58 insertions, 2 deletions
diff --git a/test/test/00-setup.js b/test/test/00-setup.js index e95c4eac..cbbf8c19 100644 --- a/test/test/00-setup.js +++ b/test/test/00-setup.js @@ -1 +1 @@ -Error.stackTraceLimit = 1 +//Error.stackTraceLimit = 1 diff --git a/test/test/04-cart.js b/test/test/04-cart.js index a628eeb9..f2304a26 100644 --- a/test/test/04-cart.js +++ b/test/test/04-cart.js @@ -38,12 +38,40 @@ describe('cart', function(){ }) }) }) - + describe('#add_item()', function(){ + /* + it('adds item to cart', function(done){ + var product_item = { + "Code10": "37725683OV", + "Size": 2, + "Section": "", + } + promise(sdk.cart.add_item, { data: product_item }).then(function(data){ + assert(data.Header.StatusCode == 200) + done() + }) + }) + */ }) + describe('#delete_item()', function(){ }) describe('#get_status()', function(){ + + it('get contents of cart', function(done){ + var user_creds = { + "UserId": sdk.auth.user_id, + "UserToken": sdk.auth.access_token, + } + promise(sdk.cart.get_status, { data: user_creds }).then(function(data){ + assert(data.Header.StatusCode == 200) + done() + }) + }) + + + }) }) @@ -57,8 +85,36 @@ describe('cart', function(){ describe('shipping', function(){ describe('#set_shipping_address()', function(){ + it('set shipping address', function(done){ + var shipping_info = { + "Name":"Nome SecondoNome", + "Surname":"Cognome SecondoCognome", + "Phone":"333333333", + "CareOf":"Care of", + "Email":"prova@prova.it", + "Mobile":"333333333", + "VatNumber":"VatNumber", + "StreetWithNumber":"StreetNumber", + "Region":"Region", + "PostalCode":"88040", + "City":"City", + "CountryCode":"IT", + } + promise(sdk.cart.set_shipping_address, { data: shipping_info }).then(function(data){ + assert(data.Header.StatusCode == 200) + done() + }) + }) }) describe('#get_box_types()', function(){ + it('get box types', function(done){ + promise(sdk.shipping.get_box_types, { data: {} }).then(function(data){ + console.log("ok"); + console.log(data) + assert(data.Header.StatusCode == 200) + done() + }) + }) }) describe('#set_box_type()', function(){ }) |
