From e3001539194016bb90790491a480e892152ac0e8 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Wed, 5 Oct 2016 12:20:35 +1100 Subject: [PATCH] Test github issue 23: derivation path on bip32 tab --- tests.js | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/tests.js b/tests.js index c09a8fd..557eaa7 100644 --- a/tests.js +++ b/tests.js @@ -1652,8 +1652,56 @@ page.open(url, function(status) { }); }, -// Github Issue 23: Use correct derivation path when changing tabs +// Github Issue 23: Part 1: Use correct derivation path when changing tabs // https://github.com/dcpos/bip39/issues/23 +function() { +page.open(url, function(status) { + // 1) and 2) set the phrase + page.evaluate(function() { + $(".phrase").val("abandon abandon ability").trigger("input"); + }); + waitForGenerate(function() { + // 3) select bip32 tab + page.evaluate(function() { + $("#bip32-tab a").click(); + }); + waitForGenerate(function() { + // 4) switch from bitcoin to litecoin + page.evaluate(function() { + $(".network").val("2").trigger("change"); + }); + waitForGenerate(function() { + // 5) Check derivation path is displayed correctly + var expected = "m/0/0"; + var actual = page.evaluate(function() { + return $(".index:first").text(); + }); + if (actual != expected) { + console.log("Github Issue 23 Part 1: derivation path display error"); + console.log("Expected: " + expected); + console.log("Actual: " + actual); + fail(); + } + // 5) Check address is displayed correctly + var expected = "LS8MP5LZ5AdzSZveRrjm3aYVoPgnfFh5T5"; + var actual = page.evaluate(function() { + return $(".address:first").text(); + }); + if (actual != expected) { + console.log("Github Issue 23 Part 1: address display error"); + console.log("Expected: " + expected); + console.log("Actual: " + actual); + fail(); + } + next(); + }); + }); + }); +}); +}, + +// Github Issue 23 Part 2: Coin selection in derivation path +// https://github.com/dcpos/bip39/issues/23#issuecomment-238011920 // Github Issue 26: When using a Root key derrived altcoins are incorrect // https://github.com/dcpos/bip39/issues/26 -- 2.41.0