diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2016-10-05 12:11:31 +1100 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2016-10-05 12:11:31 +1100 |
commit | a7becc4305fd0f0a35370a79870803afe7b34639 (patch) | |
tree | 58cb71fb9ab64d30450f3b4a9a4481c16b097270 /tests.js | |
parent | c97627faa4496083767edd58c4e3de4d569ad89f (diff) | |
download | BIP39-a7becc4305fd0f0a35370a79870803afe7b34639.tar.gz BIP39-a7becc4305fd0f0a35370a79870803afe7b34639.tar.zst BIP39-a7becc4305fd0f0a35370a79870803afe7b34639.zip |
Test mnemonic is not sensitive to whitespace
Diffstat (limited to 'tests.js')
-rw-r--r-- | tests.js | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -1627,6 +1627,30 @@ page.open(url, function(status) { | |||
1627 | 1627 | ||
1628 | // Github Issue 19: Mnemonic is not sensitive to whitespace | 1628 | // Github Issue 19: Mnemonic is not sensitive to whitespace |
1629 | // https://github.com/dcpos/bip39/issues/19 | 1629 | // https://github.com/dcpos/bip39/issues/19 |
1630 | function() { | ||
1631 | page.open(url, function(status) { | ||
1632 | // set the phrase | ||
1633 | var expected = "xprv9s21ZrQH143K3isaZsWbKVoTtbvd34Y1ZGRugGdMeBGbM3AgBVzTH159mj1cbbtYSJtQr65w6L5xy5L9SFC7c9VJZWHxgAzpj4mun5LhrbC"; | ||
1634 | page.evaluate(function() { | ||
1635 | var doubleSpace = " "; | ||
1636 | $(".phrase").val("urge cat" + doubleSpace + "bid"); | ||
1637 | $(".phrase").trigger("input"); | ||
1638 | }); | ||
1639 | waitForGenerate(function() { | ||
1640 | // Check the bip32 root key is correct | ||
1641 | var actual = page.evaluate(function() { | ||
1642 | return $(".root-key").val(); | ||
1643 | }); | ||
1644 | if (actual != expected) { | ||
1645 | console.log("Mnemonic is sensitive to whitespace"); | ||
1646 | console.log("Expected: " + expected); | ||
1647 | console.log("Actual: " + actual); | ||
1648 | fail(); | ||
1649 | } | ||
1650 | next(); | ||
1651 | }); | ||
1652 | }); | ||
1653 | }, | ||
1630 | 1654 | ||
1631 | // Github Issue 23: Use correct derivation path when changing tabs | 1655 | // Github Issue 23: Use correct derivation path when changing tabs |
1632 | // https://github.com/dcpos/bip39/issues/23 | 1656 | // https://github.com/dcpos/bip39/issues/23 |