]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Add PIVX network tests
authorIan Coleman <coleman.ian@gmail.com>
Mon, 14 Aug 2017 05:27:24 +0000 (15:27 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Mon, 14 Aug 2017 05:27:24 +0000 (15:27 +1000)
tests.js

index 4a67ed717e901472575ca73407bc0229da9b9b53..dea908bec26429fc562986683e2a45685b91bdd3 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -932,6 +932,66 @@ page.open(url, function(status) {
 });
 },
 
+// Network can be set to pivx
+function() {
+page.open(url, function(status) {
+    // set the phrase and coin
+    var expected = "DBxgT7faCuno7jmtKuu6KWCiwqsVPqh1tS";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+        $(".network option[selected]").removeAttr("selected");
+        $(".network option").filter(function() {
+            return $(this).html() == "PIVX - PIVX";
+        }).prop("selected", true);
+        $(".network").trigger("change");
+    });
+    // check the address is generated correctly
+    waitForGenerate(function() {
+        var actual = page.evaluate(function() {
+            return $(".address:first").text();
+        });
+        if (actual != expected) {
+            console.log("PIVX address is incorrect");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
+// Network can be set to pivx testnet
+function() {
+page.open(url, function(status) {
+    // set the phrase and coin
+    var expected = "yB5U384n6dGkVE3by5y9VdvHHPwPg68fQj";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+        $(".network option[selected]").removeAttr("selected");
+        $(".network option").filter(function() {
+            return $(this).html() == "PIVX - PIVX Testnet";
+        }).prop("selected", true);
+        $(".network").trigger("change");
+    });
+    // check the address is generated correctly
+    waitForGenerate(function() {
+        var actual = page.evaluate(function() {
+            return $(".address:first").text();
+        });
+        if (actual != expected) {
+            console.log("PIVX Testnet address is incorrect");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
 // BIP39 seed is set from phrase
 function() {
 page.open(url, function(status) {