diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-11 13:41:54 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-11 13:41:54 -0500 |
| commit | 9d30013e953e570552cd86dbb2795ec56b8d1035 (patch) | |
| tree | ccaec83e82e461f1206120e740e256bff96b2c08 /test | |
| parent | b1f7de54a87cff0f2a1d2b1837c5532c9c847be3 (diff) | |
delete item api working
Diffstat (limited to 'test')
| -rw-r--r-- | test/test/04-cart.js | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/test/test/04-cart.js b/test/test/04-cart.js index f2304a26..55736b39 100644 --- a/test/test/04-cart.js +++ b/test/test/04-cart.js @@ -40,25 +40,32 @@ describe('cart', function(){ }) describe('#add_item()', function(){ - /* it('adds item to cart', function(done){ var product_item = { "Code10": "37725683OV", - "Size": 2, - "Section": "", - } + "Size": 4, + } promise(sdk.cart.add_item, { data: product_item }).then(function(data){ - assert(data.Header.StatusCode == 200) + assert(data.Header.StatusCode == 201) done() }) }) - */ }) describe('#delete_item()', function(){ + it('removes item from cart', function(done){ + var product_item = { + "Code10": "37725683OV", + "Size": 4, + } + promise(sdk.cart.delete_item, { data: product_item }).then(function(data){ + // console.log(data) + assert(data.Header.StatusCode == 200) + done() + }) + }) }) describe('#get_status()', function(){ - it('get contents of cart', function(done){ var user_creds = { "UserId": sdk.auth.user_id, @@ -66,12 +73,10 @@ describe('cart', function(){ } promise(sdk.cart.get_status, { data: user_creds }).then(function(data){ assert(data.Header.StatusCode == 200) + // console.log(data) done() }) }) - - - }) }) @@ -87,18 +92,16 @@ 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", + "Name":"Nome", + "Surname":"Cognome", "Email":"prova@prova.it", - "Mobile":"333333333", - "VatNumber":"VatNumber", - "StreetWithNumber":"StreetNumber", - "Region":"Region", - "PostalCode":"88040", - "City":"City", - "CountryCode":"IT", + "Phone":"333-333-3333", + "Mobile":"333-333-3333", + "StreetWithNumber":"555 StreetNumber\nBlah Blah", + "PostalCode":"11101", + "City":"Long Island City", + "Region":"NY", + "CountryCode":"US", } promise(sdk.cart.set_shipping_address, { data: shipping_info }).then(function(data){ assert(data.Header.StatusCode == 200) |
