diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2016-08-30 15:56:20 +1000 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2016-08-30 15:56:20 +1000 |
commit | bfb3dab65c0770f024942f85974ef325beb371ce (patch) | |
tree | 3532286b8d986335d7567d38416d3be0dd6ed598 | |
parent | 694767c01e27c3705e802cf46363fb509e056670 (diff) | |
download | BIP39-bfb3dab65c0770f024942f85974ef325beb371ce.tar.gz BIP39-bfb3dab65c0770f024942f85974ef325beb371ce.tar.zst BIP39-bfb3dab65c0770f024942f85974ef325beb371ce.zip |
Tests for namecoin and peercoin
-rw-r--r-- | tests.js | 56 |
1 files changed, 56 insertions, 0 deletions
@@ -485,6 +485,62 @@ page.open(url, function(status) { | |||
485 | }); | 485 | }); |
486 | }, | 486 | }, |
487 | 487 | ||
488 | // Network can be set to namecoin | ||
489 | function() { | ||
490 | page.open(url, function(status) { | ||
491 | // set the phrase and coin | ||
492 | var expected = "Mw2vK2Bvex1yYtYF6sfbEg2YGoUc98YUD2"; | ||
493 | page.evaluate(function() { | ||
494 | $(".phrase").val("abandon abandon ability"); | ||
495 | $(".phrase").trigger("input"); | ||
496 | $(".network option[selected]").removeAttr("selected"); | ||
497 | $(".network option[value=11]").prop("selected", true); | ||
498 | $(".network").trigger("change"); | ||
499 | }); | ||
500 | // check the address is generated correctly | ||
501 | waitForGenerate(function() { | ||
502 | var actual = page.evaluate(function() { | ||
503 | return $(".address:first").text(); | ||
504 | }); | ||
505 | if (actual != expected) { | ||
506 | console.log("Namecoin address is incorrect"); | ||
507 | console.log("Expected: " + expected); | ||
508 | console.log("Actual: " + actual); | ||
509 | fail(); | ||
510 | } | ||
511 | next(); | ||
512 | }); | ||
513 | }); | ||
514 | }, | ||
515 | |||
516 | // Network can be set to peercoin | ||
517 | function() { | ||
518 | page.open(url, function(status) { | ||
519 | // set the phrase and coin | ||
520 | var expected = "PVAiioTaK2eDHSEo3tppT9AVdBYqxRTBAm"; | ||
521 | page.evaluate(function() { | ||
522 | $(".phrase").val("abandon abandon ability"); | ||
523 | $(".phrase").trigger("input"); | ||
524 | $(".network option[selected]").removeAttr("selected"); | ||
525 | $(".network option[value=12]").prop("selected", true); | ||
526 | $(".network").trigger("change"); | ||
527 | }); | ||
528 | // check the address is generated correctly | ||
529 | waitForGenerate(function() { | ||
530 | var actual = page.evaluate(function() { | ||
531 | return $(".address:first").text(); | ||
532 | }); | ||
533 | if (actual != expected) { | ||
534 | console.log("Peercoin address is incorrect"); | ||
535 | console.log("Expected: " + expected); | ||
536 | console.log("Actual: " + actual); | ||
537 | fail(); | ||
538 | } | ||
539 | next(); | ||
540 | }); | ||
541 | }); | ||
542 | }, | ||
543 | |||
488 | // BIP39 seed is set from phrase | 544 | // BIP39 seed is set from phrase |
489 | function() { | 545 | function() { |
490 | page.open(url, function(status) { | 546 | page.open(url, function(status) { |