diff options
Diffstat (limited to 'tests.js')
-rw-r--r-- | tests.js | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -2774,6 +2774,31 @@ page.open(url, function(status) { | |||
2774 | }); | 2774 | }); |
2775 | }, | 2775 | }, |
2776 | 2776 | ||
2777 | // Mnemonic length can be selected even for weak entropy | ||
2778 | function() { | ||
2779 | page.open(url, function(status) { | ||
2780 | // use entropy | ||
2781 | page.evaluate(function() { | ||
2782 | $(".use-entropy").prop("checked", true).trigger("change"); | ||
2783 | $(".entropy").val("012345"); | ||
2784 | $(".mnemonic-length").val("18").trigger("change"); | ||
2785 | }); | ||
2786 | // check the mnemonic is the correct length | ||
2787 | waitForGenerate(function() { | ||
2788 | var phrase = page.evaluate(function() { | ||
2789 | return $(".phrase").val(); | ||
2790 | }); | ||
2791 | var numberOfWords = phrase.split(/\s/g).length; | ||
2792 | if (numberOfWords != 18) { | ||
2793 | console.log("Weak entropy cannot be overridden to give 18 word mnemonic"); | ||
2794 | console.log(phrase); | ||
2795 | fail(); | ||
2796 | } | ||
2797 | next(); | ||
2798 | }); | ||
2799 | }); | ||
2800 | }, | ||
2801 | |||
2777 | // If you wish to add more tests, do so here... | 2802 | // If you wish to add more tests, do so here... |
2778 | 2803 | ||
2779 | // Here is a blank test template | 2804 | // Here is a blank test template |