aboutsummaryrefslogtreecommitdiff
path: root/tests.js
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2016-08-30 15:56:20 +1000
committerIan Coleman <coleman.ian@gmail.com>2016-08-30 15:56:20 +1000
commitbfb3dab65c0770f024942f85974ef325beb371ce (patch)
tree3532286b8d986335d7567d38416d3be0dd6ed598 /tests.js
parent694767c01e27c3705e802cf46363fb509e056670 (diff)
downloadBIP39-bfb3dab65c0770f024942f85974ef325beb371ce.tar.gz
BIP39-bfb3dab65c0770f024942f85974ef325beb371ce.tar.zst
BIP39-bfb3dab65c0770f024942f85974ef325beb371ce.zip
Tests for namecoin and peercoin
Diffstat (limited to 'tests.js')
-rw-r--r--tests.js56
1 files changed, 56 insertions, 0 deletions
diff --git a/tests.js b/tests.js
index f82ce0d..35bc972 100644
--- a/tests.js
+++ b/tests.js
@@ -485,6 +485,62 @@ page.open(url, function(status) {
485}); 485});
486}, 486},
487 487
488// Network can be set to namecoin
489function() {
490page.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
517function() {
518page.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
489function() { 545function() {
490page.open(url, function(status) { 546page.open(url, function(status) {