From: Ian Coleman Date: Sat, 3 Sep 2016 05:35:58 +0000 (+1000) Subject: Test custom number of additional addresses X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=8a89b9da97e437f9ce9476951896e51a9764800c;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git Test custom number of additional addresses --- diff --git a/tests.js b/tests.js index 0c28ec8..124b6ce 100644 --- a/tests.js +++ b/tests.js @@ -1214,6 +1214,43 @@ page.open(url, function(status) { }, // A custom number of additional addresses can be generated +function() { +page.open(url, function(status) { + // set the phrase + page.evaluate(function() { + $(".phrase").val("abandon abandon ability"); + $(".phrase").trigger("input"); + }); + waitForGenerate(function() { + // get the current number of addresses + var oldAddressCount = page.evaluate(function() { + return $(".address").length; + }); + // set a custom number of additional addresses + page.evaluate(function() { + $(".rows-to-add").val(1); + }); + // generate more addresses + page.evaluate(function() { + $(".more").click(); + }); + waitForGenerate(function() { + // check there are the correct number of addresses + var newAddressCount = page.evaluate(function() { + return $(".address").length; + }); + if (newAddressCount - oldAddressCount != 1) { + console.log("Number of additional addresses cannot be customized"); + console.log(newAddressCount) + console.log(oldAddressCount) + fail(); + } + next(); + }); + }); +}); +}, + // Additional addresses are shown in order of derivation path // BIP32 root key can be set by the user