diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-22 15:15:32 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-22 15:15:32 -0500 |
| commit | 46bca0d394d4c327d692a081f9afedcf7e05c146 (patch) | |
| tree | 05655d88f5549a20839eec0158c75e093afeed98 | |
| parent | 0b330d8d365f8cba80d0ead6f59f66cc6ee1ffcd (diff) | |
signup works
| -rw-r--r-- | StoneIsland/www/js/lib/account/AccountView.js | 5 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/auth/SignupView.js | 6 | ||||
| -rw-r--r-- | test/test/04-cart.js | 8 | ||||
| -rw-r--r-- | test/test/05-cart-flows.js | 46 |
4 files changed, 60 insertions, 5 deletions
diff --git a/StoneIsland/www/js/lib/account/AccountView.js b/StoneIsland/www/js/lib/account/AccountView.js index 221640c5..8f53b27f 100644 --- a/StoneIsland/www/js/lib/account/AccountView.js +++ b/StoneIsland/www/js/lib/account/AccountView.js @@ -14,6 +14,11 @@ var AccountView = View.extend({ }, populateAddresses: function(data){ + console.log("populate addresses:", data) + if (! data.AddressBook) { + console.log("no addresses") + return + } data.AddressBook.forEach(function(address){ if (addressBookItem.isDefault) { // populate app.shipping.address diff --git a/StoneIsland/www/js/lib/auth/SignupView.js b/StoneIsland/www/js/lib/auth/SignupView.js index 71d3c8d0..367bd356 100644 --- a/StoneIsland/www/js/lib/auth/SignupView.js +++ b/StoneIsland/www/js/lib/auth/SignupView.js @@ -16,9 +16,13 @@ var SignupView = FormView.extend({ }, show: function(){ + var msg = "* Your personal and payment<br>information will always remain private" + if (auth.logged_in()) { + msg += "<br><br>You are already logged in." + } app.footer.show("SUBMIT", "CANCEL") this.$form.get(0).reset() - this.$msg.html("* Your personal and payment<br />information will always remain private") + this.$msg.html(msg) document.body.className = "signup" }, diff --git a/test/test/04-cart.js b/test/test/04-cart.js index d394b59f..7944758b 100644 --- a/test/test/04-cart.js +++ b/test/test/04-cart.js @@ -82,7 +82,7 @@ describe('cart', function(){ describe('shipping', function(){ describe('#set_shipping_address()', function(){ - it('set shipping address', function(done){ + it('sets shipping address', function(done){ var shipping_info = { "Name":"Nome", "Surname":"Cognome", @@ -102,7 +102,7 @@ describe('shipping', function(){ }) }) describe('#get_box_types()', function(){ - it('get box types', function(done){ + it('gets box types', function(done){ promise(sdk.shipping.get_box_types, { data: {} }).then(function(data){ // console.log(data) assert(data.Header.StatusCode == 200) @@ -111,7 +111,7 @@ describe('shipping', function(){ }) }) describe('#set_box_type()', function(){ - it('set box types', function(done){ + it('sets box types', function(done){ // box might be hard coded to 'standard' ? var box_type = { "Type": "Standard" @@ -136,7 +136,7 @@ describe('shipping', function(){ //RETURNING A 415 ERROR (which isnt listed as potential error).. ? - it('set delivery type', function(done){ + it('sets delivery type', function(done){ var d_type = { "Id": 1, } diff --git a/test/test/05-cart-flows.js b/test/test/05-cart-flows.js index c5173f3d..96ccfaf5 100644 --- a/test/test/05-cart-flows.js +++ b/test/test/05-cart-flows.js @@ -45,5 +45,51 @@ describe('cart_flows', function(){ done() }) }) + + it('sets shipping address', function(done){ + var shipping_info = { + "Name":"Nome", + "Surname":"Cognome", + "Email":"prova@prova.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) + done() + }) + }) + + it('sets credit card', function(done){ + + var credit_info = { + "Guid": null, + "HolderName": "Name2", + "HolderSurname": "Surname2", + "HolderAddress": "via del pino, 4", + "HolderCity": "Monterenzio", + "HolderProvince": "BO", + "HolderZip": "40050", + "HolderISOCountry": "IT", + "HolderEmail": "mailTest@mail2.it", + "CardNumber": "123456789012345", + "Type": "Visa", + "ExpirationMonth": "1", + "ExpirationYear": "12", + "Cvv": "123", + "Last4": "2345", + } + + promise(sdk.cart.set_credit_card, { data: credit_info }).then(function(data){ + assert(data.Header.StatusCode == 200) + done() + }) + }) + }) })
\ No newline at end of file |
