X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests.js;h=464a15dde87c535bce9b061aaf82419a07ae1062;hb=e40acc3ab0e78ca3a9b63d0b1c9e16f804da104e;hp=dea908bec26429fc562986683e2a45685b91bdd3;hpb=47b64d3ee12f475fc939b9fbfc3f7ae2578ea2e1;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/tests.js b/tests.js index dea908b..464a15d 100644 --- a/tests.js +++ b/tests.js @@ -4120,6 +4120,41 @@ page.open(url, function(status) { }); }, +// github issue 43 +// Cleared mnemonic and root key still allows addresses to be generated +// https://github.com/iancoleman/bip39/issues/43 +function() { +page.open(url, function(status) { + // set the phrase + page.evaluate(function() { + $("#bip49-tab a").click(); + $(".phrase").val("abandon abandon ability"); + $(".phrase").trigger("input"); + }); + waitForGenerate(function() { + // clear the mnemonic and root key + page.evaluate(function() { + $(".phrase").val(""); + $(".phrase").trigger("input"); + $(".root-key").val(""); + $(".root-key").trigger("input"); + $(".more").click(); + }); + waitForFeedback(function() { + // check there are no addresses shown + var addressCount = page.evaluate(function() { + return $(".address").length; + }); + if (addressCount != 0) { + console.log("Clearing mnemonic should not allow addresses to be generated"); + fail(); + } + next(); + }); + }); +}); +}, + // If you wish to add more tests, do so here... // Here is a blank test template