]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - tests.js
add test for GAME
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / tests.js
index d55b8f4730379bb34a9591362939427a282266ce..49d42c3e049fc24bc500b1a7caac75a949e08ca2 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -571,6 +571,36 @@ page.open(url, function(status) {
 });
 },
 
+// Network can be set to game
+function() {
+page.open(url, function(status) {
+    // set the phrase and coin
+    var expected = "GSMY9bAp36cMR4zyT4uGVS7GFjpdXbao5Q";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+        $(".network option[selected]").removeAttr("selected");
+        $(".network option").filter(function() {
+            return $(this).html() == "GAME";
+        }).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("GAME address is incorrect");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
 // Network can be set to namecoin
 function() {
 page.open(url, function(status) {