aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/spec/tests.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/spec/tests.js b/tests/spec/tests.js
index 945a923..034b50f 100644
--- a/tests/spec/tests.js
+++ b/tests/spec/tests.js
@@ -3530,4 +3530,36 @@ it('Does not show a warning if generating strong mnemonics', function(done) {
3530 }); 3530 });
3531}); 3531});
3532 3532
3533it('Shows a warning if overriding weak entropy with longer mnemonics', function(done) {
3534 driver.findElement(By.css('.use-entropy'))
3535 .click();
3536 driver.findElement(By.css('.entropy'))
3537 .sendKeys("0123456789abcdef"); // 6 words
3538 driver.executeScript(function() {
3539 $(".mnemonic-length").val("12").trigger("change");
3540 });
3541 driver.findElement(By.css(".weak-entropy-override-warning"))
3542 .getAttribute("class")
3543 .then(function(classes) {
3544 expect(classes).not.toContain("hidden");
3545 done();
3546 });
3547});
3548
3549it('Does not show a warning if entropy is stronger than mnemonic length', function(done) {
3550 driver.findElement(By.css('.use-entropy'))
3551 .click();
3552 driver.findElement(By.css('.entropy'))
3553 .sendKeys("0123456789abcdef0123456789abcdef0123456789abcdef"); // 18 words
3554 driver.executeScript(function() {
3555 $(".mnemonic-length").val("12").trigger("change");
3556 });
3557 driver.findElement(By.css(".weak-entropy-override-warning"))
3558 .getAttribute("class")
3559 .then(function(classes) {
3560 expect(classes).toContain("hidden");
3561 done();
3562 });
3563});
3564
3533}); 3565});