diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2017-10-10 12:04:27 +1100 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2017-10-10 12:04:27 +1100 |
commit | 0cca6e893af22e7b6d4e3621a8a0bf3c68c00e41 (patch) | |
tree | 299c156d9f6d9b43ec97546d744ac79417c6008a | |
parent | f2a1a8e67fb2ba69861d4f60ac3dc2fcf8f4ed3f (diff) | |
download | BIP39-0cca6e893af22e7b6d4e3621a8a0bf3c68c00e41.tar.gz BIP39-0cca6e893af22e7b6d4e3621a8a0bf3c68c00e41.tar.zst BIP39-0cca6e893af22e7b6d4e3621a8a0bf3c68c00e41.zip |
Add test for nubits network
-rw-r--r-- | tests.js | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -1052,6 +1052,36 @@ page.open(url, function(status) { | |||
1052 | }); | 1052 | }); |
1053 | }, | 1053 | }, |
1054 | 1054 | ||
1055 | // Network can be set to nubits | ||
1056 | function() { | ||
1057 | page.open(url, function(status) { | ||
1058 | // set the phrase and coin | ||
1059 | var expected = "BLxkabXuZSJSdesLD7KxZdqovd4YwyBTU6"; | ||
1060 | page.evaluate(function() { | ||
1061 | $(".phrase").val("abandon abandon ability"); | ||
1062 | $(".phrase").trigger("input"); | ||
1063 | $(".network option[selected]").removeAttr("selected"); | ||
1064 | $(".network option").filter(function() { | ||
1065 | return $(this).html() == "USNBT - NuBits"; | ||
1066 | }).prop("selected", true); | ||
1067 | $(".network").trigger("change"); | ||
1068 | }); | ||
1069 | // check the address is generated correctly | ||
1070 | waitForGenerate(function() { | ||
1071 | var actual = page.evaluate(function() { | ||
1072 | return $(".address:first").text(); | ||
1073 | }); | ||
1074 | if (actual != expected) { | ||
1075 | console.log("NuBits address is incorrect"); | ||
1076 | console.log("Expected: " + expected); | ||
1077 | console.log("Actual: " + actual); | ||
1078 | fail(); | ||
1079 | } | ||
1080 | next(); | ||
1081 | }); | ||
1082 | }); | ||
1083 | }, | ||
1084 | |||
1055 | // BIP39 seed is set from phrase | 1085 | // BIP39 seed is set from phrase |
1056 | function() { | 1086 | function() { |
1057 | page.open(url, function(status) { | 1087 | page.open(url, function(status) { |