]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Test phrase is retained unless user confirms
authorIan Coleman <coleman.ian@gmail.com>
Thu, 15 Sep 2016 02:16:02 +0000 (12:16 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Thu, 15 Sep 2016 02:16:02 +0000 (12:16 +1000)
tests.js

index 97cb646b4780633d771ea767e36f7ae29c6986d5..7c67b02036e69a5c0089f1733403e531d0e9549b 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -1345,6 +1345,33 @@ page.open(url, function(status) {
 },
 
 // Clearing of phrase, passphrase and seed can be cancelled by user
+function() {
+page.open(url, function(status) {
+    var expected = "abandon abandon ability";
+    // set a mnemonic
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+    });
+    // Cancel any confirm dialogs
+    page.onConfirm = function() {
+        return false;
+    };
+    // set the root key
+    page.evaluate(function() {
+        $(".root-key").val("xprv9s21ZrQH143K3d3vzEDD3KpSKmxsZ3y7CqhAL1tinwtP6wqK4TKEKjpBuo6P2hUhB6ZENo7TTSRytiP857hBZVpBdk8PooFuRspE1eywwNZ").trigger("input");
+    });
+    var actual = page.evaluate(function() {
+        return $(".phrase").val();
+    });
+    if (actual != expected) {
+        console.log("Phrase not retained when cancelling changes to BIP32 root key");
+        console.log("Expected: " + expected);
+        console.log("Actual: " + actual);
+        fail();
+    }
+    next();
+});
+},
 // Custom BIP32 root key is used when changing the derivation path
 
 // Incorrect mnemonic shows error