X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fspec%2Ftests.js;h=945a9232adfffb91d514ed0f1befad6a1e3b2969;hb=85c906727a24ab97a3c2908c72ad37ad988ecb01;hp=571047f340fcbf12960797ba2090bcbbf6829a3b;hpb=d1b4c8c579b34924fbce919c423f3c9baab81083;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git 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) { }); }); +it('Shows a warning if generating weak mnemonics', function(done) { + driver.executeScript(function() { + $(".strength option[selected]").removeAttr("selected"); + $(".strength option[value=6]").prop("selected", true); + $(".strength").trigger("change"); + }); + driver.findElement(By.css(".generate-container .warning")) + .getAttribute("class") + .then(function(classes) { + expect(classes).not.toContain("hidden"); + done(); + }); +}); + +it('Does not show a warning if generating strong mnemonics', function(done) { + driver.executeScript(function() { + $(".strength option[selected]").removeAttr("selected"); + $(".strength option[value=12]").prop("selected", true); + }); + driver.findElement(By.css(".generate-container .warning")) + .getAttribute("class") + .then(function(classes) { + expect(classes).toContain("hidden"); + done(); + }); +}); + });