diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2016-08-24 20:18:05 +1000 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2016-08-24 20:18:05 +1000 |
commit | 06c4c6e31411158c1e9ff1943f12886991005120 (patch) | |
tree | d7f2a0757e0a911cf1dbc9e16b3e1a1e3e6cb21a | |
parent | a775b5c66d26e4c57b3d2bb9515e31c6ecd187a8 (diff) | |
download | BIP39-06c4c6e31411158c1e9ff1943f12886991005120.tar.gz BIP39-06c4c6e31411158c1e9ff1943f12886991005120.tar.zst BIP39-06c4c6e31411158c1e9ff1943f12886991005120.zip |
Test table shows addresses
-rw-r--r-- | tests.js | 32 |
1 files changed, 27 insertions, 5 deletions
@@ -101,18 +101,17 @@ page.open(url, function(status) { | |||
101 | // Entering mnemonic generates addresses | 101 | // Entering mnemonic generates addresses |
102 | function() { | 102 | function() { |
103 | page.open(url, function(status) { | 103 | page.open(url, function(status) { |
104 | var expected = "1Di3Vp7tBWtyQaDABLAjfWtF6V7hYKJtug"; | ||
105 | // set the phrase | 104 | // set the phrase |
106 | page.evaluate(function() { | 105 | page.evaluate(function() { |
107 | $(".phrase").val("abandon abandon ability").trigger("input"); | 106 | $(".phrase").val("abandon abandon ability").trigger("input"); |
108 | }); | 107 | }); |
109 | // get the address | 108 | // get the address |
110 | waitForGenerate(function() { | 109 | waitForGenerate(function() { |
111 | var actual = page.evaluate(function() { | 110 | var addressCount = page.evaluate(function() { |
112 | return $(".address:first").text(); | 111 | return $(".address").length; |
113 | }); | 112 | }); |
114 | if (actual != expected) { | 113 | if (addressCount != 20) { |
115 | console.log("Mnemonic did not generate address"); | 114 | console.log("Mnemonic did not generate addresses"); |
116 | console.log("Expected: " + expected); | 115 | console.log("Expected: " + expected); |
117 | console.log("Got: " + actual); | 116 | console.log("Got: " + actual); |
118 | fail(); | 117 | fail(); |
@@ -971,6 +970,29 @@ page.open(url, function(status) { | |||
971 | }, | 970 | }, |
972 | 971 | ||
973 | // Address is shown | 972 | // Address is shown |
973 | function() { | ||
974 | page.open(url, function(status) { | ||
975 | var expected = "1Di3Vp7tBWtyQaDABLAjfWtF6V7hYKJtug"; | ||
976 | // set the phrase | ||
977 | page.evaluate(function() { | ||
978 | $(".phrase").val("abandon abandon ability").trigger("input"); | ||
979 | }); | ||
980 | // get the address | ||
981 | waitForGenerate(function() { | ||
982 | var actual = page.evaluate(function() { | ||
983 | return $(".address:first").text(); | ||
984 | }); | ||
985 | if (actual != expected) { | ||
986 | console.log("Address is not shown"); | ||
987 | console.log("Expected: " + expected); | ||
988 | console.log("Got: " + actual); | ||
989 | fail(); | ||
990 | } | ||
991 | next(); | ||
992 | }); | ||
993 | }); | ||
994 | }, | ||
995 | |||
974 | // Addresses are shown in order of derivation path | 996 | // Addresses are shown in order of derivation path |
975 | // Address visibility can be toggled | 997 | // Address visibility can be toggled |
976 | // Private key is shown | 998 | // Private key is shown |