diff options
author | Ian Coleman <ian@iancoleman.io> | 2020-11-30 00:35:56 +0000 |
---|---|---|
committer | Ian Coleman <ian@iancoleman.io> | 2020-11-30 00:35:56 +0000 |
commit | ac7f150a798d9edb9ce7506e60c03ed1f33ebaa2 (patch) | |
tree | 1610c82a0b523a381dfa3ce2dccd83168846c0f9 /tests | |
parent | 134213954d6380e8b5293e94d59f75b9a9a23df6 (diff) | |
download | BIP39-ac7f150a798d9edb9ce7506e60c03ed1f33ebaa2.tar.gz BIP39-ac7f150a798d9edb9ce7506e60c03ed1f33ebaa2.tar.zst BIP39-ac7f150a798d9edb9ce7506e60c03ed1f33ebaa2.zip |
Remove non-English BIP85 languages
Diffstat (limited to 'tests')
-rw-r--r-- | tests/spec/tests.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/spec/tests.js b/tests/spec/tests.js index f0b50e7..0332f96 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js | |||
@@ -168,6 +168,17 @@ function selectNetwork(name) { | |||
168 | }, name); | 168 | }, name); |
169 | } | 169 | } |
170 | 170 | ||
171 | function selectBip85Language(language) { | ||
172 | driver.executeScript(function() { | ||
173 | var selectText = arguments[0]; | ||
174 | $(".bip85-mnemonic-language option[selected]").removeAttr("selected"); | ||
175 | $(".bip85-mnemonic-language option").filter(function(i,e) { | ||
176 | return $(e).html() == selectText; | ||
177 | }).prop("selected", true); | ||
178 | $(".bip85-mnemonic-language").trigger("change"); | ||
179 | }, language); | ||
180 | } | ||
181 | |||
171 | function testEntropyType(done, entropyText, entropyTypeUnsafe) { | 182 | function testEntropyType(done, entropyText, entropyTypeUnsafe) { |
172 | // entropy type is compiled into regexp so needs escaping | 183 | // entropy type is compiled into regexp so needs escaping |
173 | // see https://stackoverflow.com/a/2593661 | 184 | // see https://stackoverflow.com/a/2593661 |
@@ -4988,6 +4999,25 @@ it('Show BIP85', function(done) { | |||
4988 | }); | 4999 | }); |
4989 | }); | 5000 | }); |
4990 | 5001 | ||
5002 | it('Show BIP85 in non-English languages', function(done) { | ||
5003 | pending("BIP85 library update"); | ||
5004 | var originalPhrase = "install scatter logic circle pencil average fall shoe quantum disease suspect usage"; | ||
5005 | driver.findElement(By.css('.phrase')) | ||
5006 | .sendKeys(originalPhrase); | ||
5007 | driver.sleep(generateDelay).then(function() { | ||
5008 | driver.findElement(By.css('.showBip85')).click(); | ||
5009 | selectBip85Language("3"); | ||
5010 | driver.findElement(By.css('.showBip85')).isSelected().then(function(isSelected) { | ||
5011 | expect(isSelected).toBe(true) | ||
5012 | driver.findElement(By.css('#bip85Field')).getAttribute("value").then(function(childMnemonic) { | ||
5013 | expect(childMnemonic).not.toBe('girl mad pet galaxy egg matter matrix prison refuse sense ordinary nose') | ||
5014 | //expect(childMnemonic).toBe('Not sure yet, something Spanish') | ||
5015 | done(); | ||
5016 | }) | ||
5017 | }); | ||
5018 | }); | ||
5019 | }); | ||
5020 | |||
4991 | // It allows manually specifying the entropy type | 5021 | // It allows manually specifying the entropy type |
4992 | it('Allows entropy type to be manually selected', function(done) { | 5022 | it('Allows entropy type to be manually selected', function(done) { |
4993 | driver.findElement(By.css('.use-entropy')) | 5023 | driver.findElement(By.css('.use-entropy')) |