X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests.js;h=6d24eccffec6f973eb92f391210f09805a8edccd;hb=21372fab36d3a500feda29b52ae8d8a007c11f8f;hp=9889e0b5887219487bf6c8774eaba4e2f6719e0a;hpb=06c4c6e31411158c1e9ff1943f12886991005120;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/tests.js b/tests.js index 9889e0b..6d24ecc 100644 --- a/tests.js +++ b/tests.js @@ -457,6 +457,34 @@ page.open(url, function(status) { }); }, +// Network can be set to dash +function() { +page.open(url, function(status) { + // set the phrase and coin + var expected = "XdbhtMuGsPSkE6bPdNTHoFSszQKmK4S5LT"; + page.evaluate(function() { + $(".phrase").val("abandon abandon ability"); + $(".phrase").trigger("input"); + $(".network option[selected]").removeAttr("selected"); + $(".network option[value=10]").prop("selected", true); + $(".network").trigger("change"); + }); + // check the address is generated correctly + waitForGenerate(function() { + var actual = page.evaluate(function() { + return $(".address:first").text(); + }); + if (actual != expected) { + console.log("DASH address is incorrect"); + console.log("Expected: " + expected); + console.log("Actual: " + actual); + fail(); + } + next(); + }); +}); +}, + // BIP39 seed is set from phrase function() { page.open(url, function(status) { @@ -950,7 +978,6 @@ page.open(url, function(status) { $(".phrase").val("abandon abandon ability"); $(".phrase").trigger("input"); }); - // check the path is not shown waitForGenerate(function() { // toggle path visibility page.evaluate(function() { @@ -994,7 +1021,64 @@ page.open(url, function(status) { }, // Addresses are shown in order of derivation path +function() { +page.open(url, function(status) { + // set the phrase + page.evaluate(function() { + $(".phrase").val("abandon abandon ability").trigger("input"); + }); + // get the derivation paths + waitForGenerate(function() { + var paths = page.evaluate(function() { + return $(".index").map(function(i, e) { + return $(e).text(); + }); + }); + if (paths.length != 20) { + console.log("Total paths is less than expected: " + paths.length); + fail(); + } + for (var i=0; i