diff options
Diffstat (limited to 'tests.js')
-rw-r--r-- | tests.js | 50 |
1 files changed, 50 insertions, 0 deletions
@@ -1166,6 +1166,56 @@ page.open(url, function(status) { | |||
1166 | }); | 1166 | }); |
1167 | }, | 1167 | }, |
1168 | 1168 | ||
1169 | // Public key is shown | ||
1170 | function() { | ||
1171 | page.open(url, function(status) { | ||
1172 | var expected = "033f5aed5f6cfbafaf223188095b5980814897295f723815fea5d3f4b648d0d0b3"; | ||
1173 | // set the phrase | ||
1174 | page.evaluate(function() { | ||
1175 | $(".phrase").val("abandon abandon ability").trigger("input"); | ||
1176 | }); | ||
1177 | // get the address | ||
1178 | waitForGenerate(function() { | ||
1179 | var actual = page.evaluate(function() { | ||
1180 | return $(".pubkey:first").text(); | ||
1181 | }); | ||
1182 | if (actual != expected) { | ||
1183 | console.log("Public key is not shown"); | ||
1184 | console.log("Expected: " + expected); | ||
1185 | console.log("Got: " + actual); | ||
1186 | fail(); | ||
1187 | } | ||
1188 | next(); | ||
1189 | }); | ||
1190 | }); | ||
1191 | }, | ||
1192 | |||
1193 | // Public key visibility can be toggled | ||
1194 | function() { | ||
1195 | page.open(url, function(status) { | ||
1196 | // set the phrase | ||
1197 | page.evaluate(function() { | ||
1198 | $(".phrase").val("abandon abandon ability"); | ||
1199 | $(".phrase").trigger("input"); | ||
1200 | }); | ||
1201 | waitForGenerate(function() { | ||
1202 | // toggle public key visibility | ||
1203 | page.evaluate(function() { | ||
1204 | $(".public-key-toggle").click(); | ||
1205 | }); | ||
1206 | // check the public key is not visible | ||
1207 | var isInvisible = page.evaluate(function() { | ||
1208 | return $(".pubkey:first span").hasClass("invisible"); | ||
1209 | }); | ||
1210 | if (!isInvisible) { | ||
1211 | console.log("Toggled public key is visible"); | ||
1212 | fail(); | ||
1213 | } | ||
1214 | next(); | ||
1215 | }); | ||
1216 | }); | ||
1217 | }, | ||
1218 | |||
1169 | // Private key is shown | 1219 | // Private key is shown |
1170 | function() { | 1220 | function() { |
1171 | page.open(url, function(status) { | 1221 | page.open(url, function(status) { |