aboutsummaryrefslogtreecommitdiff
path: root/tests.js
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2017-08-16 10:43:09 +1000
committerIan Coleman <coleman.ian@gmail.com>2017-08-16 10:43:09 +1000
commited6d9d3905aa581f1a76d37d601c6be39954d1ff (patch)
treeadb9b239acf04ff3011af37161e616ad1e25be5c /tests.js
parent47b64d3ee12f475fc939b9fbfc3f7ae2578ea2e1 (diff)
downloadBIP39-ed6d9d3905aa581f1a76d37d601c6be39954d1ff.tar.gz
BIP39-ed6d9d3905aa581f1a76d37d601c6be39954d1ff.tar.zst
BIP39-ed6d9d3905aa581f1a76d37d601c6be39954d1ff.zip
Clear old seed when mnemonic is changed
Diffstat (limited to 'tests.js')
-rw-r--r--tests.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests.js b/tests.js
index dea908b..464a15d 100644
--- a/tests.js
+++ b/tests.js
@@ -4120,6 +4120,41 @@ page.open(url, function(status) {
4120}); 4120});
4121}, 4121},
4122 4122
4123// github issue 43
4124// Cleared mnemonic and root key still allows addresses to be generated
4125// https://github.com/iancoleman/bip39/issues/43
4126function() {
4127page.open(url, function(status) {
4128 // set the phrase
4129 page.evaluate(function() {
4130 $("#bip49-tab a").click();
4131 $(".phrase").val("abandon abandon ability");
4132 $(".phrase").trigger("input");
4133 });
4134 waitForGenerate(function() {
4135 // clear the mnemonic and root key
4136 page.evaluate(function() {
4137 $(".phrase").val("");
4138 $(".phrase").trigger("input");
4139 $(".root-key").val("");
4140 $(".root-key").trigger("input");
4141 $(".more").click();
4142 });
4143 waitForFeedback(function() {
4144 // check there are no addresses shown
4145 var addressCount = page.evaluate(function() {
4146 return $(".address").length;
4147 });
4148 if (addressCount != 0) {
4149 console.log("Clearing mnemonic should not allow addresses to be generated");
4150 fail();
4151 }
4152 next();
4153 });
4154 });
4155});
4156},
4157
4123// If you wish to add more tests, do so here... 4158// If you wish to add more tests, do so here...
4124 4159
4125// Here is a blank test template 4160// Here is a blank test template