diff options
author | Ian Coleman <ian@iancoleman.io> | 2017-11-22 15:28:58 +1100 |
---|---|---|
committer | Ian Coleman <ian@iancoleman.io> | 2017-11-22 15:37:36 +1100 |
commit | 74ab4cbe90d037604120c93230ac9b0d74a6c7f1 (patch) | |
tree | c9c71ea4c4032f46f8adcce76a720a7115643a4f /tests/spec | |
parent | cf6c2044973413e3cfcda03079c6a66756fb023c (diff) | |
download | BIP39-74ab4cbe90d037604120c93230ac9b0d74a6c7f1.tar.gz BIP39-74ab4cbe90d037604120c93230ac9b0d74a6c7f1.tar.zst BIP39-74ab4cbe90d037604120c93230ac9b0d74a6c7f1.zip |
Show entropy from PRNG and word indexes
see issue #132
Diffstat (limited to 'tests/spec')
-rw-r--r-- | tests/spec/tests.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/spec/tests.js b/tests/spec/tests.js index 2b28d73..409219b 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js | |||
@@ -2643,4 +2643,31 @@ it('Can generate BIP141 addresses with P2WPKH semanitcs', function(done) { | |||
2643 | }); | 2643 | }); |
2644 | }); | 2644 | }); |
2645 | 2645 | ||
2646 | it('Shows the entropy used by the PRNG when clicking generate', function(done) { | ||
2647 | driver.findElement(By.css('.generate')).click(); | ||
2648 | driver.sleep(generateDelay).then(function() { | ||
2649 | driver.findElement(By.css('.entropy')) | ||
2650 | .getAttribute("value") | ||
2651 | .then(function(entropy) { | ||
2652 | expect(entropy).not.toBe(""); | ||
2653 | done(); | ||
2654 | }); | ||
2655 | }); | ||
2656 | }); | ||
2657 | |||
2658 | it('Shows the index of each word in the mnemonic', function(done) { | ||
2659 | driver.findElement(By.css('.phrase')) | ||
2660 | .sendKeys("abandon abandon ability"); | ||
2661 | driver.sleep(generateDelay).then(function() { | ||
2662 | driver.findElement(By.css('.use-entropy')) | ||
2663 | .click(); | ||
2664 | driver.findElement(By.css('.word-indexes')) | ||
2665 | .getText() | ||
2666 | .then(function(indexes) { | ||
2667 | expect(indexes).toBe("0, 0, 1"); | ||
2668 | done(); | ||
2669 | }); | ||
2670 | }); | ||
2671 | }); | ||
2672 | |||
2646 | }); | 2673 | }); |