aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreasGassmann <andreas@andreasgassmann.ch>2020-11-09 00:46:58 +0100
committerAndreasGassmann <andreas@andreasgassmann.ch>2020-11-09 00:46:58 +0100
commitf2f8d8177e0b04a46144bfaf5141e48532208e5f (patch)
treec611d45897135de5c0214f1b44cabaa52b52f780
parent877b8bdfecabed14e8d5e8a84365743b81da0175 (diff)
downloadBIP39-f2f8d8177e0b04a46144bfaf5141e48532208e5f.tar.gz
BIP39-f2f8d8177e0b04a46144bfaf5141e48532208e5f.tar.zst
BIP39-f2f8d8177e0b04a46144bfaf5141e48532208e5f.zip
feat(test): add bip85 test
-rw-r--r--src/js/index.js6
-rw-r--r--tests/spec/tests.js18
2 files changed, 23 insertions, 1 deletions
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 @@
464 function toggleBip85() { 464 function toggleBip85() {
465 if (DOM.showBip85.prop('checked')) { 465 if (DOM.showBip85.prop('checked')) {
466 DOM.bip85.removeClass('hidden'); 466 DOM.bip85.removeClass('hidden');
467 toggleBip85Fields(); 467 calcBip85();
468 } else { 468 } else {
469 DOM.bip85.addClass('hidden'); 469 DOM.bip85.addClass('hidden');
470 } 470 }
@@ -487,6 +487,10 @@
487 } 487 }
488 488
489 function calcBip85() { 489 function calcBip85() {
490 if (!DOM.showBip85.prop('checked')) {
491 return
492 }
493
490 toggleBip85Fields(); 494 toggleBip85Fields();
491 495
492 var app = DOM.bip85application.val(); 496 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) {
4960 }); 4960 });
4961}); 4961});
4962 4962
4963// Pull Request 454 https://github.com/iancoleman/bip39/pull/454
4964// Add BIP85 support
4965it('Show BIP85', function(done) {
4966 var originalPhrase = "install scatter logic circle pencil average fall shoe quantum disease suspect usage";
4967 driver.findElement(By.css('.phrase'))
4968 .sendKeys(originalPhrase);
4969 driver.sleep(generateDelay).then(function() {
4970 driver.findElement(By.css('.showBip85')).click();
4971 driver.findElement(By.css('.showBip85')).isSelected().then(function(isSelected) {
4972 expect(isSelected).toBe(true)
4973 driver.findElement(By.css('#bip85Field')).getAttribute("value").then(function(childMnemonic) {
4974 expect(childMnemonic).toBe('girl mad pet galaxy egg matter matrix prison refuse sense ordinary nose')
4975 done();
4976 })
4977 });
4978 });
4979});
4980
4963// It allows manually specifying the entropy type 4981// It allows manually specifying the entropy type
4964it('Allows entropy type to be manually selected', function(done) { 4982it('Allows entropy type to be manually selected', function(done) {
4965 driver.findElement(By.css('.use-entropy')) 4983 driver.findElement(By.css('.use-entropy'))