]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Test ordering of addresses in table
authorIan Coleman <coleman.ian@gmail.com>
Fri, 26 Aug 2016 02:21:55 +0000 (12:21 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Fri, 26 Aug 2016 02:21:55 +0000 (12:21 +1000)
tests.js

index 47938a4b54a0905e3db20eae0124ad0a8daab2ee..12a6c5bf398de5d2d8360b9a92d10ba0d4d8097e 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -1022,6 +1022,37 @@ page.open(url, function(status) {
 },
 
 // Addresses are shown in order of derivation path
+function() {
+page.open(url, function(status) {
+    // set the phrase
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability").trigger("input");
+    });
+    // get the derivation paths
+    waitForGenerate(function() {
+        var paths = page.evaluate(function() {
+            return $(".index").map(function(i, e) {
+                return $(e).text();
+            });
+        });
+        if (paths.length != 20) {
+            console.log("Total paths is less than expected: " + paths.length);
+            fail();
+        }
+        for (var i=0; i<paths.length; i++) {
+            var expected = "m/44'/0'/0'/0/" + i;
+            var actual = paths[i];
+            if (actual != expected) {
+                console.log("Path " + i + " is incorrect");
+                console.log("Expected: " + expected);
+                console.log("Actual: " + actual);
+                fail();
+            }
+        }
+        next();
+    });
+});
+},
 // Address visibility can be toggled
 // Private key is shown
 // Private key visibility can be toggled