]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Test table shows addresses
authorIan Coleman <coleman.ian@gmail.com>
Wed, 24 Aug 2016 10:18:05 +0000 (20:18 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Wed, 24 Aug 2016 10:18:05 +0000 (20:18 +1000)
tests.js

index bb3c4fcaadf0ac23ad48e776bd3418d858293bd0..9889e0b5887219487bf6c8774eaba4e2f6719e0a 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -101,18 +101,17 @@ page.open(url, function(status) {
 // Entering mnemonic generates addresses
 function() {
 page.open(url, function(status) {
-    var expected = "1Di3Vp7tBWtyQaDABLAjfWtF6V7hYKJtug";
     // set the phrase
     page.evaluate(function() {
         $(".phrase").val("abandon abandon ability").trigger("input");
     });
     // get the address
     waitForGenerate(function() {
-        var actual = page.evaluate(function() {
-            return $(".address:first").text();
+        var addressCount = page.evaluate(function() {
+            return $(".address").length;
         });
-        if (actual != expected) {
-            console.log("Mnemonic did not generate address");
+        if (addressCount != 20) {
+            console.log("Mnemonic did not generate addresses");
             console.log("Expected: " + expected);
             console.log("Got: " + actual);
             fail();
@@ -971,6 +970,29 @@ page.open(url, function(status) {
 },
 
 // Address is shown
+function() {
+page.open(url, function(status) {
+    var expected = "1Di3Vp7tBWtyQaDABLAjfWtF6V7hYKJtug";
+    // set the phrase
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability").trigger("input");
+    });
+    // get the address
+    waitForGenerate(function() {
+        var actual = page.evaluate(function() {
+            return $(".address:first").text();
+        });
+        if (actual != expected) {
+            console.log("Address is not shown");
+            console.log("Expected: " + expected);
+            console.log("Got: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
 // Addresses are shown in order of derivation path
 // Address visibility can be toggled
 // Private key is shown