]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Test derivation path not starting with m
authorIan Coleman <coleman.ian@gmail.com>
Mon, 3 Oct 2016 00:18:37 +0000 (11:18 +1100)
committerIan Coleman <coleman.ian@gmail.com>
Mon, 3 Oct 2016 00:18:37 +0000 (11:18 +1100)
tests.js

index 90dcab5e580856093cb2334fedafa9fb14ac9da0..49a95b7e3e48e96bda6fdf295c4e193d8754d740 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -1500,6 +1500,38 @@ page.open(url, function(status) {
 },
 
 // Derivation path not starting with m shows error
+function() {
+page.open(url, function(status) {
+    // set the mnemonic phrase
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability").trigger("input");
+    });
+    waitForGenerate(function() {
+        // select the bip32 tab so custom derivation path can be set
+        page.evaluate(function() {
+            $("#bip32-tab a").click();
+        });
+        waitForGenerate(function() {
+            // set the incorrect derivation path
+            page.evaluate(function() {
+                $("#bip32 .path").val("n/0").trigger("input");
+            });
+            waitForFeedback(function() {
+                var feedback = page.evaluate(function() {
+                    return $(".feedback").text();
+                });
+                if (feedback != "First character must be 'm'") {
+                    console.log("Derivation path not starting with m should show error");
+                    console.log("Error: " + error);
+                    fail();
+                }
+                next();
+            });
+        });
+    });
+});
+},
+
 // Derivation path containing invalid characters shows useful error
 
 // Github Issue 11: Default word length is 15