aboutsummaryrefslogtreecommitdiff
path: root/tests/spec/tests.js
diff options
context:
space:
mode:
authorIan Coleman <ian@iancoleman.io>2018-04-12 11:46:44 +1000
committerIan Coleman <ian@iancoleman.io>2018-04-12 12:08:52 +1000
commit85c906727a24ab97a3c2908c72ad37ad988ecb01 (patch)
treea2481ff3c2c8965c2086c0cbf317ead5d988f6d3 /tests/spec/tests.js
parentd1b4c8c579b34924fbce919c423f3c9baab81083 (diff)
downloadBIP39-85c906727a24ab97a3c2908c72ad37ad988ecb01.tar.gz
BIP39-85c906727a24ab97a3c2908c72ad37ad988ecb01.tar.zst
BIP39-85c906727a24ab97a3c2908c72ad37ad988ecb01.zip
Warn when generating low entropy mnemonics
Diffstat (limited to 'tests/spec/tests.js')
-rw-r--r--tests/spec/tests.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/spec/tests.js b/tests/spec/tests.js
index 571047f..945a923 100644
--- a/tests/spec/tests.js
+++ b/tests/spec/tests.js
@@ -3503,4 +3503,31 @@ it('Uses vprv for bitcoin testnet p2wpkh', function(done) {
3503 }); 3503 });
3504}); 3504});
3505 3505
3506it('Shows a warning if generating weak mnemonics', function(done) {
3507 driver.executeScript(function() {
3508 $(".strength option[selected]").removeAttr("selected");
3509 $(".strength option[value=6]").prop("selected", true);
3510 $(".strength").trigger("change");
3511 });
3512 driver.findElement(By.css(".generate-container .warning"))
3513 .getAttribute("class")
3514 .then(function(classes) {
3515 expect(classes).not.toContain("hidden");
3516 done();
3517 });
3518});
3519
3520it('Does not show a warning if generating strong mnemonics', function(done) {
3521 driver.executeScript(function() {
3522 $(".strength option[selected]").removeAttr("selected");
3523 $(".strength option[value=12]").prop("selected", true);
3524 });
3525 driver.findElement(By.css(".generate-container .warning"))
3526 .getAttribute("class")
3527 .then(function(classes) {
3528 expect(classes).toContain("hidden");
3529 done();
3530 });
3531});
3532
3506}); 3533});