From ac7f150a798d9edb9ce7506e60c03ed1f33ebaa2 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Mon, 30 Nov 2020 00:35:56 +0000 Subject: [PATCH] Remove non-English BIP85 languages --- src/index.html | 4 ++-- 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 @@
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) { }, name); } +function selectBip85Language(language) { + driver.executeScript(function() { + var selectText = arguments[0]; + $(".bip85-mnemonic-language option[selected]").removeAttr("selected"); + $(".bip85-mnemonic-language option").filter(function(i,e) { + return $(e).html() == selectText; + }).prop("selected", true); + $(".bip85-mnemonic-language").trigger("change"); + }, language); +} + function testEntropyType(done, entropyText, entropyTypeUnsafe) { // entropy type is compiled into regexp so needs escaping // see https://stackoverflow.com/a/2593661 @@ -4988,6 +4999,25 @@ it('Show BIP85', function(done) { }); }); +it('Show BIP85 in non-English languages', function(done) { + pending("BIP85 library update"); + var originalPhrase = "install scatter logic circle pencil average fall shoe quantum disease suspect usage"; + driver.findElement(By.css('.phrase')) + .sendKeys(originalPhrase); + driver.sleep(generateDelay).then(function() { + driver.findElement(By.css('.showBip85')).click(); + selectBip85Language("3"); + driver.findElement(By.css('.showBip85')).isSelected().then(function(isSelected) { + expect(isSelected).toBe(true) + driver.findElement(By.css('#bip85Field')).getAttribute("value").then(function(childMnemonic) { + expect(childMnemonic).not.toBe('girl mad pet galaxy egg matter matrix prison refuse sense ordinary nose') + //expect(childMnemonic).toBe('Not sure yet, something Spanish') + done(); + }) + }); + }); +}); + // It allows manually specifying the entropy type it('Allows entropy type to be manually selected', function(done) { driver.findElement(By.css('.use-entropy')) -- 2.41.0