diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2017-01-04 11:30:45 +1100 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2017-01-04 11:31:45 +1100 |
commit | 40892aba5013cd75927f63e66492f46b2d206ec9 (patch) | |
tree | 35f45854960e6fd6c30a11016ac89dc000977053 /tests.js | |
parent | 6ea15134a4ff5a443d96de5882bcddbe7300fc6f (diff) | |
download | BIP39-40892aba5013cd75927f63e66492f46b2d206ec9.tar.gz BIP39-40892aba5013cd75927f63e66492f46b2d206ec9.tar.zst BIP39-40892aba5013cd75927f63e66492f46b2d206ec9.zip |
Generation process stopped when table rows cleared
Closes #44
Diffstat (limited to 'tests.js')
-rw-r--r-- | tests.js | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -3291,6 +3291,50 @@ page.open(url, function(status) { | |||
3291 | }); | 3291 | }); |
3292 | }, | 3292 | }, |
3293 | 3293 | ||
3294 | // Github issue 44 | ||
3295 | // display error switching tabs while addresses are generating | ||
3296 | function() { | ||
3297 | page.open(url, function(status) { | ||
3298 | // set the phrase | ||
3299 | page.evaluate(function() { | ||
3300 | $(".phrase").val("abandon abandon ability").trigger("input"); | ||
3301 | }); | ||
3302 | waitForGenerate(function() { | ||
3303 | // set to generate 500 more addresses | ||
3304 | // generate more addresses | ||
3305 | // change tabs which should cancel the previous generating | ||
3306 | page.evaluate(function() { | ||
3307 | $(".rows-to-add").val("100"); | ||
3308 | $(".more").click(); | ||
3309 | $("#bip32-tab a").click(); | ||
3310 | }); | ||
3311 | // check the derivation paths are in order and of the right quantity | ||
3312 | waitForGenerate(function() { | ||
3313 | var paths = page.evaluate(function() { | ||
3314 | return $(".index").map(function(i, e) { | ||
3315 | return $(e).text(); | ||
3316 | }); | ||
3317 | }); | ||
3318 | for (var i=0; i<paths.length; i++) { | ||
3319 | var expected = "m/0/" + i; | ||
3320 | var actual = paths[i]; | ||
3321 | if (actual != expected) { | ||
3322 | console.log("Path " + i + " is not in correct order"); | ||
3323 | console.log("Expected: " + expected); | ||
3324 | console.log("Actual: " + actual); | ||
3325 | fail(); | ||
3326 | } | ||
3327 | } | ||
3328 | if (paths.length != 20) { | ||
3329 | console.log("Generation was not cancelled by new action"); | ||
3330 | fail(); | ||
3331 | } | ||
3332 | next(); | ||
3333 | }); | ||
3334 | }); | ||
3335 | }); | ||
3336 | }, | ||
3337 | |||
3294 | // If you wish to add more tests, do so here... | 3338 | // If you wish to add more tests, do so here... |
3295 | 3339 | ||
3296 | // Here is a blank test template | 3340 | // Here is a blank test template |