diff options
-rw-r--r-- | src/index.html | 4 | ||||
-rw-r--r-- | tests/spec/tests.js | 30 |
2 files changed, 32 insertions, 2 deletions
diff --git a/src/index.html b/src/index.html index a802dd2..64839fe 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -302,14 +302,14 @@ | |||
302 | <div class="col-sm-10 languages"> | 302 | <div class="col-sm-10 languages"> |
303 | <select id="bip85-mnemonic-language" class="strength form-control"> | 303 | <select id="bip85-mnemonic-language" class="strength form-control"> |
304 | <option value="0" selected>English</option> | 304 | <option value="0" selected>English</option> |
305 | <option value="1">日本語</option> | 305 | <!--<option value="1">日本語</option> |
306 | <option value="2">한국어</option> | 306 | <option value="2">한국어</option> |
307 | <option value="3">Español</option> | 307 | <option value="3">Español</option> |
308 | <option value="4">中文(简体)</option> | 308 | <option value="4">中文(简体)</option> |
309 | <option value="5">中文(繁體)</option> | 309 | <option value="5">中文(繁體)</option> |
310 | <option value="6">Français</option> | 310 | <option value="6">Français</option> |
311 | <option value="7">Italiano</option> | 311 | <option value="7">Italiano</option> |
312 | <option value="8">Čeština</option> | 312 | <option value="8">Čeština</option>--> |
313 | </select> | 313 | </select> |
314 | </div> | 314 | </div> |
315 | </div> | 315 | </div> |
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')) |