diff options
-rw-r--r-- | tests.js | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -1345,6 +1345,33 @@ page.open(url, function(status) { | |||
1345 | }, | 1345 | }, |
1346 | 1346 | ||
1347 | // Clearing of phrase, passphrase and seed can be cancelled by user | 1347 | // Clearing of phrase, passphrase and seed can be cancelled by user |
1348 | function() { | ||
1349 | page.open(url, function(status) { | ||
1350 | var expected = "abandon abandon ability"; | ||
1351 | // set a mnemonic | ||
1352 | page.evaluate(function() { | ||
1353 | $(".phrase").val("abandon abandon ability"); | ||
1354 | }); | ||
1355 | // Cancel any confirm dialogs | ||
1356 | page.onConfirm = function() { | ||
1357 | return false; | ||
1358 | }; | ||
1359 | // set the root key | ||
1360 | page.evaluate(function() { | ||
1361 | $(".root-key").val("xprv9s21ZrQH143K3d3vzEDD3KpSKmxsZ3y7CqhAL1tinwtP6wqK4TKEKjpBuo6P2hUhB6ZENo7TTSRytiP857hBZVpBdk8PooFuRspE1eywwNZ").trigger("input"); | ||
1362 | }); | ||
1363 | var actual = page.evaluate(function() { | ||
1364 | return $(".phrase").val(); | ||
1365 | }); | ||
1366 | if (actual != expected) { | ||
1367 | console.log("Phrase not retained when cancelling changes to BIP32 root key"); | ||
1368 | console.log("Expected: " + expected); | ||
1369 | console.log("Actual: " + actual); | ||
1370 | fail(); | ||
1371 | } | ||
1372 | next(); | ||
1373 | }); | ||
1374 | }, | ||
1348 | // Custom BIP32 root key is used when changing the derivation path | 1375 | // Custom BIP32 root key is used when changing the derivation path |
1349 | 1376 | ||
1350 | // Incorrect mnemonic shows error | 1377 | // Incorrect mnemonic shows error |