X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests.js;h=37a758f4f1e8626a11bcbf9301f88ef06ca01915;hb=3599674db4855614d9123f2f80dcf0a37c34eb79;hp=420873dc11bd2a126df003b5f15d62a08f6734aa;hpb=1cf1bbaff575e647ef38b091a00edfa2e1ce024d;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/tests.js b/tests.js index 420873d..37a758f 100644 --- a/tests.js +++ b/tests.js @@ -2774,6 +2774,31 @@ page.open(url, function(status) { }); }, +// Mnemonic length can be selected even for weak entropy +function() { +page.open(url, function(status) { + // use entropy + page.evaluate(function() { + $(".use-entropy").prop("checked", true).trigger("change"); + $(".entropy").val("012345"); + $(".mnemonic-length").val("18").trigger("change"); + }); + // check the mnemonic is the correct length + waitForGenerate(function() { + var phrase = page.evaluate(function() { + return $(".phrase").val(); + }); + var numberOfWords = phrase.split(/\s/g).length; + if (numberOfWords != 18) { + console.log("Weak entropy cannot be overridden to give 18 word mnemonic"); + console.log(phrase); + fail(); + } + next(); + }); +}); +}, + // If you wish to add more tests, do so here... // Here is a blank test template