From 06c4c6e31411158c1e9ff1943f12886991005120 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Wed, 24 Aug 2016 20:18:05 +1000 Subject: Test table shows addresses --- tests.js | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/tests.js b/tests.js index bb3c4fc..9889e0b 100644 --- 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 -- cgit v1.2.3