From f2f8d8177e0b04a46144bfaf5141e48532208e5f Mon Sep 17 00:00:00 2001 From: AndreasGassmann Date: Mon, 9 Nov 2020 00:46:58 +0100 Subject: [PATCH] feat(test): add bip85 test --- src/js/index.js | 6 +++++- tests/spec/tests.js | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/js/index.js b/src/js/index.js index 80b78bc..7aa0217 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -464,7 +464,7 @@ function toggleBip85() { if (DOM.showBip85.prop('checked')) { DOM.bip85.removeClass('hidden'); - toggleBip85Fields(); + calcBip85(); } else { DOM.bip85.addClass('hidden'); } @@ -487,6 +487,10 @@ } function calcBip85() { + if (!DOM.showBip85.prop('checked')) { + return + } + toggleBip85Fields(); var app = DOM.bip85application.val(); diff --git a/tests/spec/tests.js b/tests/spec/tests.js index efb395f..9d07edb 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js @@ -4960,6 +4960,24 @@ it('Shows split prase cards', function(done) { }); }); +// Pull Request 454 https://github.com/iancoleman/bip39/pull/454 +// Add BIP85 support +it('Show BIP85', function(done) { + var originalPhrase = "install scatter logic circle pencil average fall shoe quantum disease suspect usage"; + driver.findElement(By.css('.phrase')) + .sendKeys(originalPhrase); + driver.sleep(generateDelay).then(function() { + driver.findElement(By.css('.showBip85')).click(); + driver.findElement(By.css('.showBip85')).isSelected().then(function(isSelected) { + expect(isSelected).toBe(true) + driver.findElement(By.css('#bip85Field')).getAttribute("value").then(function(childMnemonic) { + expect(childMnemonic).toBe('girl mad pet galaxy egg matter matrix prison refuse sense ordinary nose') + done(); + }) + }); + }); +}); + // It allows manually specifying the entropy type it('Allows entropy type to be manually selected', function(done) { driver.findElement(By.css('.use-entropy')) -- 2.41.0