diff options
Diffstat (limited to 'tests.js')
-rw-r--r-- | tests.js | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -1022,6 +1022,37 @@ page.open(url, function(status) { | |||
1022 | }, | 1022 | }, |
1023 | 1023 | ||
1024 | // Addresses are shown in order of derivation path | 1024 | // Addresses are shown in order of derivation path |
1025 | function() { | ||
1026 | page.open(url, function(status) { | ||
1027 | // set the phrase | ||
1028 | page.evaluate(function() { | ||
1029 | $(".phrase").val("abandon abandon ability").trigger("input"); | ||
1030 | }); | ||
1031 | // get the derivation paths | ||
1032 | waitForGenerate(function() { | ||
1033 | var paths = page.evaluate(function() { | ||
1034 | return $(".index").map(function(i, e) { | ||
1035 | return $(e).text(); | ||
1036 | }); | ||
1037 | }); | ||
1038 | if (paths.length != 20) { | ||
1039 | console.log("Total paths is less than expected: " + paths.length); | ||
1040 | fail(); | ||
1041 | } | ||
1042 | for (var i=0; i<paths.length; i++) { | ||
1043 | var expected = "m/44'/0'/0'/0/" + i; | ||
1044 | var actual = paths[i]; | ||
1045 | if (actual != expected) { | ||
1046 | console.log("Path " + i + " is incorrect"); | ||
1047 | console.log("Expected: " + expected); | ||
1048 | console.log("Actual: " + actual); | ||
1049 | fail(); | ||
1050 | } | ||
1051 | } | ||
1052 | next(); | ||
1053 | }); | ||
1054 | }); | ||
1055 | }, | ||
1025 | // Address visibility can be toggled | 1056 | // Address visibility can be toggled |
1026 | // Private key is shown | 1057 | // Private key is shown |
1027 | // Private key visibility can be toggled | 1058 | // Private key visibility can be toggled |