]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Test BIP44 coin field
authorIan Coleman <coleman.ian@gmail.com>
Tue, 23 Aug 2016 10:03:41 +0000 (20:03 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Tue, 23 Aug 2016 10:03:41 +0000 (20:03 +1000)
tests.js

index 435d5eb9b7fb23740f207c332c36ff0728993780..c6fa59460bb7800595dbae6c6b3a11dd6c78829d 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -646,9 +646,38 @@ page.open(url, function(status) {
 });
 },
 
-// TODO finish these tests
-
 // BIP44 coin field changes address list
+function() {
+page.open(url, function(status) {
+    // set the phrase
+    var expected = "1F6dB2djQYrxoyfZZmfr6D5voH8GkJTghk";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+    });
+    waitForGenerate(function() {
+        // change the bip44 purpose field to 45
+        page.evaluate(function() {
+            $("#bip44 .coin").val("1");
+            $("#bip44 .coin").trigger("input");
+        });
+        waitForGenerate(function() {
+            // check the address for the new derivation path
+            var actual = page.evaluate(function() {
+                return $(".address:first").text();
+            });
+            if (actual != expected) {
+                console.log("BIP44 coin field generates incorrect address");
+                console.log("Expected: " + expected);
+                console.log("Actual: " + actual);
+                fail();
+            }
+            next();
+        });
+    });
+});
+},
+
 // BIP44 account field changes address list
 // BIP44 external/internal field changes address list