diff options
author | iancoleman <coleman.ian@gmail.com> | 2017-07-03 10:42:20 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-03 10:42:20 +1000 |
commit | 9dab7e5d0c6539f85b5ba24ad2c813cea4ef5c65 (patch) | |
tree | e458fe18f1d5fa3dc64c1909f1eb175b6f3caff7 /tests.js | |
parent | f1e5d48491562ae58926467da4e4c4b81b62a0f3 (diff) | |
parent | 534481b628cd6d9172b236c8b6b4ef7fab4e0f29 (diff) | |
download | BIP39-9dab7e5d0c6539f85b5ba24ad2c813cea4ef5c65.tar.gz BIP39-9dab7e5d0c6539f85b5ba24ad2c813cea4ef5c65.tar.zst BIP39-9dab7e5d0c6539f85b5ba24ad2c813cea4ef5c65.zip |
Merge pull request #81 from mikeyb/naming
Add CRW / Change bip44 dropdown naming convention
Diffstat (limited to 'tests.js')
-rw-r--r-- | tests.js | 72 |
1 files changed, 51 insertions, 21 deletions
@@ -281,7 +281,7 @@ page.open(url, function(status) { | |||
281 | $(".phrase").trigger("input"); | 281 | $(".phrase").trigger("input"); |
282 | $(".network option[selected]").removeAttr("selected"); | 282 | $(".network option[selected]").removeAttr("selected"); |
283 | $(".network option").filter(function() { | 283 | $(".network option").filter(function() { |
284 | return $(this).html() == "Bitcoin Testnet"; | 284 | return $(this).html() == "BTC - Bitcoin Testnet"; |
285 | }).prop("selected", true); | 285 | }).prop("selected", true); |
286 | $(".network").trigger("change"); | 286 | $(".network").trigger("change"); |
287 | }); | 287 | }); |
@@ -311,7 +311,7 @@ page.open(url, function(status) { | |||
311 | $(".phrase").trigger("input"); | 311 | $(".phrase").trigger("input"); |
312 | $(".network option[selected]").removeAttr("selected"); | 312 | $(".network option[selected]").removeAttr("selected"); |
313 | $(".network option").filter(function() { | 313 | $(".network option").filter(function() { |
314 | return $(this).html() == "Litecoin"; | 314 | return $(this).html() == "LTC - Litecoin"; |
315 | }).prop("selected", true); | 315 | }).prop("selected", true); |
316 | $(".network").trigger("change"); | 316 | $(".network").trigger("change"); |
317 | }); | 317 | }); |
@@ -341,7 +341,7 @@ page.open(url, function(status) { | |||
341 | $(".phrase").trigger("input"); | 341 | $(".phrase").trigger("input"); |
342 | $(".network option[selected]").removeAttr("selected"); | 342 | $(".network option[selected]").removeAttr("selected"); |
343 | $(".network option").filter(function() { | 343 | $(".network option").filter(function() { |
344 | return $(this).html() == "Ripple"; | 344 | return $(this).html() == "XRP - Ripple"; |
345 | }).prop("selected", true); | 345 | }).prop("selected", true); |
346 | $(".network").trigger("change"); | 346 | $(".network").trigger("change"); |
347 | }); | 347 | }); |
@@ -371,7 +371,7 @@ page.open(url, function(status) { | |||
371 | $(".phrase").trigger("input"); | 371 | $(".phrase").trigger("input"); |
372 | $(".network option[selected]").removeAttr("selected"); | 372 | $(".network option[selected]").removeAttr("selected"); |
373 | $(".network option").filter(function() { | 373 | $(".network option").filter(function() { |
374 | return $(this).html() == "Dogecoin"; | 374 | return $(this).html() == "DOGE - Dogecoin"; |
375 | }).prop("selected", true); | 375 | }).prop("selected", true); |
376 | $(".network").trigger("change"); | 376 | $(".network").trigger("change"); |
377 | }); | 377 | }); |
@@ -401,7 +401,7 @@ page.open(url, function(status) { | |||
401 | $(".phrase").trigger("input"); | 401 | $(".phrase").trigger("input"); |
402 | $(".network option[selected]").removeAttr("selected"); | 402 | $(".network option[selected]").removeAttr("selected"); |
403 | $(".network option").filter(function() { | 403 | $(".network option").filter(function() { |
404 | return $(this).html() == "ShadowCash"; | 404 | return $(this).html() == "SDC - ShadowCash"; |
405 | }).prop("selected", true); | 405 | }).prop("selected", true); |
406 | $(".network").trigger("change"); | 406 | $(".network").trigger("change"); |
407 | }); | 407 | }); |
@@ -431,7 +431,7 @@ page.open(url, function(status) { | |||
431 | $(".phrase").trigger("input"); | 431 | $(".phrase").trigger("input"); |
432 | $(".network option[selected]").removeAttr("selected"); | 432 | $(".network option[selected]").removeAttr("selected"); |
433 | $(".network option").filter(function() { | 433 | $(".network option").filter(function() { |
434 | return $(this).html() == "ShadowCash Testnet"; | 434 | return $(this).html() == "SDC - ShadowCash Testnet"; |
435 | }).prop("selected", true); | 435 | }).prop("selected", true); |
436 | $(".network").trigger("change"); | 436 | $(".network").trigger("change"); |
437 | }); | 437 | }); |
@@ -461,7 +461,7 @@ page.open(url, function(status) { | |||
461 | $(".phrase").trigger("input"); | 461 | $(".phrase").trigger("input"); |
462 | $(".network option[selected]").removeAttr("selected"); | 462 | $(".network option[selected]").removeAttr("selected"); |
463 | $(".network option").filter(function() { | 463 | $(".network option").filter(function() { |
464 | return $(this).html() == "Viacoin"; | 464 | return $(this).html() == "VIA - Viacoin"; |
465 | }).prop("selected", true); | 465 | }).prop("selected", true); |
466 | $(".network").trigger("change"); | 466 | $(".network").trigger("change"); |
467 | }); | 467 | }); |
@@ -491,7 +491,7 @@ page.open(url, function(status) { | |||
491 | $(".phrase").trigger("input"); | 491 | $(".phrase").trigger("input"); |
492 | $(".network option[selected]").removeAttr("selected"); | 492 | $(".network option[selected]").removeAttr("selected"); |
493 | $(".network option").filter(function() { | 493 | $(".network option").filter(function() { |
494 | return $(this).html() == "Viacoin Testnet"; | 494 | return $(this).html() == "VIA - Viacoin Testnet"; |
495 | }).prop("selected", true); | 495 | }).prop("selected", true); |
496 | $(".network").trigger("change"); | 496 | $(".network").trigger("change"); |
497 | }); | 497 | }); |
@@ -521,7 +521,7 @@ page.open(url, function(status) { | |||
521 | $(".phrase").trigger("input"); | 521 | $(".phrase").trigger("input"); |
522 | $(".network option[selected]").removeAttr("selected"); | 522 | $(".network option[selected]").removeAttr("selected"); |
523 | $(".network option").filter(function() { | 523 | $(".network option").filter(function() { |
524 | return $(this).html() == "Jumbucks"; | 524 | return $(this).html() == "JBS - Jumbucks"; |
525 | }).prop("selected", true); | 525 | }).prop("selected", true); |
526 | $(".network").trigger("change"); | 526 | $(".network").trigger("change"); |
527 | }); | 527 | }); |
@@ -551,7 +551,7 @@ page.open(url, function(status) { | |||
551 | $(".phrase").trigger("input"); | 551 | $(".phrase").trigger("input"); |
552 | $(".network option[selected]").removeAttr("selected"); | 552 | $(".network option[selected]").removeAttr("selected"); |
553 | $(".network option").filter(function() { | 553 | $(".network option").filter(function() { |
554 | return $(this).html() == "CLAM"; | 554 | return $(this).html() == "CLAM - Clams"; |
555 | }).prop("selected", true); | 555 | }).prop("selected", true); |
556 | $(".network").trigger("change"); | 556 | $(".network").trigger("change"); |
557 | }); | 557 | }); |
@@ -571,6 +571,36 @@ page.open(url, function(status) { | |||
571 | }); | 571 | }); |
572 | }, | 572 | }, |
573 | 573 | ||
574 | // Network can be set to crown | ||
575 | function() { | ||
576 | page.open(url, function(status) { | ||
577 | // set the phrase and coin | ||
578 | var expected = "18pWSwSUAQdiwMHUfFZB1fM2xue9X1FqE5"; | ||
579 | page.evaluate(function() { | ||
580 | $(".phrase").val("abandon abandon ability"); | ||
581 | $(".phrase").trigger("input"); | ||
582 | $(".network option[selected]").removeAttr("selected"); | ||
583 | $(".network option").filter(function() { | ||
584 | return $(this).html() == "CRW - Crown"; | ||
585 | }).prop("selected", true); | ||
586 | $(".network").trigger("change"); | ||
587 | }); | ||
588 | // check the address is generated correctly | ||
589 | waitForGenerate(function() { | ||
590 | var actual = page.evaluate(function() { | ||
591 | return $(".address:first").text(); | ||
592 | }); | ||
593 | if (actual != expected) { | ||
594 | console.log("CRW address is incorrect"); | ||
595 | console.log("Expected: " + expected); | ||
596 | console.log("Actual: " + actual); | ||
597 | fail(); | ||
598 | } | ||
599 | next(); | ||
600 | }); | ||
601 | }); | ||
602 | }, | ||
603 | |||
574 | // Network can be set to dash | 604 | // Network can be set to dash |
575 | function() { | 605 | function() { |
576 | page.open(url, function(status) { | 606 | page.open(url, function(status) { |
@@ -581,7 +611,7 @@ page.open(url, function(status) { | |||
581 | $(".phrase").trigger("input"); | 611 | $(".phrase").trigger("input"); |
582 | $(".network option[selected]").removeAttr("selected"); | 612 | $(".network option[selected]").removeAttr("selected"); |
583 | $(".network option").filter(function() { | 613 | $(".network option").filter(function() { |
584 | return $(this).html() == "DASH"; | 614 | return $(this).html() == "DASH - Dash"; |
585 | }).prop("selected", true); | 615 | }).prop("selected", true); |
586 | $(".network").trigger("change"); | 616 | $(".network").trigger("change"); |
587 | }); | 617 | }); |
@@ -610,7 +640,7 @@ page.open(url, function(status) { | |||
610 | $(".phrase").trigger("input"); | 640 | $(".phrase").trigger("input"); |
611 | $(".network option[selected]").removeAttr("selected"); | 641 | $(".network option[selected]").removeAttr("selected"); |
612 | $(".network option").filter(function() { | 642 | $(".network option").filter(function() { |
613 | return $(this).html() == "DASH Testnet"; | 643 | return $(this).html() == "DASH - Dash Testnet"; |
614 | }).prop("selected", true); | 644 | }).prop("selected", true); |
615 | $(".network").trigger("change"); | 645 | $(".network").trigger("change"); |
616 | }); | 646 | }); |
@@ -640,7 +670,7 @@ page.open(url, function(status) { | |||
640 | $(".phrase").trigger("input"); | 670 | $(".phrase").trigger("input"); |
641 | $(".network option[selected]").removeAttr("selected"); | 671 | $(".network option[selected]").removeAttr("selected"); |
642 | $(".network option").filter(function() { | 672 | $(".network option").filter(function() { |
643 | return $(this).html() == "GAME"; | 673 | return $(this).html() == "GAME - GameCredits"; |
644 | }).prop("selected", true); | 674 | }).prop("selected", true); |
645 | $(".network").trigger("change"); | 675 | $(".network").trigger("change"); |
646 | }); | 676 | }); |
@@ -670,7 +700,7 @@ page.open(url, function(status) { | |||
670 | $(".phrase").trigger("input"); | 700 | $(".phrase").trigger("input"); |
671 | $(".network option[selected]").removeAttr("selected"); | 701 | $(".network option[selected]").removeAttr("selected"); |
672 | $(".network option").filter(function() { | 702 | $(".network option").filter(function() { |
673 | return $(this).html() == "Namecoin"; | 703 | return $(this).html() == "NMC - Namecoin"; |
674 | }).prop("selected", true); | 704 | }).prop("selected", true); |
675 | $(".network").trigger("change"); | 705 | $(".network").trigger("change"); |
676 | }); | 706 | }); |
@@ -700,7 +730,7 @@ page.open(url, function(status) { | |||
700 | $(".phrase").trigger("input"); | 730 | $(".phrase").trigger("input"); |
701 | $(".network option[selected]").removeAttr("selected"); | 731 | $(".network option[selected]").removeAttr("selected"); |
702 | $(".network option").filter(function() { | 732 | $(".network option").filter(function() { |
703 | return $(this).html() == "Peercoin"; | 733 | return $(this).html() == "PPC - Peercoin"; |
704 | }).prop("selected", true); | 734 | }).prop("selected", true); |
705 | $(".network").trigger("change"); | 735 | $(".network").trigger("change"); |
706 | }); | 736 | }); |
@@ -731,7 +761,7 @@ page.open(url, function(status) { | |||
731 | $(".phrase").trigger("input"); | 761 | $(".phrase").trigger("input"); |
732 | $(".network option[selected]").removeAttr("selected"); | 762 | $(".network option[selected]").removeAttr("selected"); |
733 | $(".network option").filter(function() { | 763 | $(".network option").filter(function() { |
734 | return $(this).html() == "Ethereum"; | 764 | return $(this).html() == "ETH - Ethereum"; |
735 | }).prop("selected", true); | 765 | }).prop("selected", true); |
736 | $(".network").trigger("change"); | 766 | $(".network").trigger("change"); |
737 | }); | 767 | }); |
@@ -792,7 +822,7 @@ page.open(url, function(status) { | |||
792 | $(".phrase").trigger("input"); | 822 | $(".phrase").trigger("input"); |
793 | $(".network option[selected]").removeAttr("selected"); | 823 | $(".network option[selected]").removeAttr("selected"); |
794 | $(".network option").filter(function() { | 824 | $(".network option").filter(function() { |
795 | return $(this).html() == "Slimcoin"; | 825 | return $(this).html() == "SLM - Slimcoin"; |
796 | }).prop("selected", true); | 826 | }).prop("selected", true); |
797 | $(".network").trigger("change"); | 827 | $(".network").trigger("change"); |
798 | }); | 828 | }); |
@@ -822,7 +852,7 @@ page.open(url, function(status) { | |||
822 | $(".phrase").trigger("input"); | 852 | $(".phrase").trigger("input"); |
823 | $(".network option[selected]").removeAttr("selected"); | 853 | $(".network option[selected]").removeAttr("selected"); |
824 | $(".network option").filter(function() { | 854 | $(".network option").filter(function() { |
825 | return $(this).html() == "Slimcoin Testnet"; | 855 | return $(this).html() == "SLM - Slimcoin Testnet"; |
826 | }).prop("selected", true); | 856 | }).prop("selected", true); |
827 | $(".network").trigger("change"); | 857 | $(".network").trigger("change"); |
828 | }); | 858 | }); |
@@ -2014,7 +2044,7 @@ page.open(url, function(status) { | |||
2014 | // 4) switch from bitcoin to litecoin | 2044 | // 4) switch from bitcoin to litecoin |
2015 | page.evaluate(function() { | 2045 | page.evaluate(function() { |
2016 | $(".network option").filter(function() { | 2046 | $(".network option").filter(function() { |
2017 | return $(this).html() == "Litecoin"; | 2047 | return $(this).html() == "LTC - Litecoin"; |
2018 | }).prop("selected", true); | 2048 | }).prop("selected", true); |
2019 | $(".network").trigger("change"); | 2049 | $(".network").trigger("change"); |
2020 | }); | 2050 | }); |
@@ -2060,7 +2090,7 @@ page.open(url, function(status) { | |||
2060 | // switch from bitcoin to clam | 2090 | // switch from bitcoin to clam |
2061 | page.evaluate(function() { | 2091 | page.evaluate(function() { |
2062 | $(".network option").filter(function() { | 2092 | $(".network option").filter(function() { |
2063 | return $(this).html() == "CLAM"; | 2093 | return $(this).html() == "CLAM - Clams"; |
2064 | }).prop("selected", true); | 2094 | }).prop("selected", true); |
2065 | $(".network").trigger("change"); | 2095 | $(".network").trigger("change"); |
2066 | }); | 2096 | }); |
@@ -2094,7 +2124,7 @@ page.open(url, function(status) { | |||
2094 | // 4) switch from bitcoin to viacoin | 2124 | // 4) switch from bitcoin to viacoin |
2095 | page.evaluate(function() { | 2125 | page.evaluate(function() { |
2096 | $(".network option").filter(function() { | 2126 | $(".network option").filter(function() { |
2097 | return $(this).html() == "Viacoin"; | 2127 | return $(this).html() == "VIA - Viacoin"; |
2098 | }).prop("selected", true); | 2128 | }).prop("selected", true); |
2099 | $(".network").trigger("change"); | 2129 | $(".network").trigger("change"); |
2100 | }); | 2130 | }); |