]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - tests/spec/tests.js
Remove non-English BIP85 languages
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / tests / spec / tests.js
index c4f318866228aa2397874ad1e607e0a6d8ad2c62..0332f96ac7985f9314d2f901aecdc8c691eda68d 100644 (file)
@@ -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
@@ -1216,7 +1227,17 @@ it('Allows selection of FIO', function(done) {
 });
 it('Allows selection of Firo', function(done) {
     var params = {
-        selectText: "FIRO - Firo",
+        selectText: "FIRO - Firo (Zcoin rebrand)",
+        phrase: "abandon abandon ability",
+        firstAddress: "a6VcMdP4XgAA9Tr7xNszmPG5FZpfRf17Cq",
+        firstPubKey: "0236f2348c32dc62d69488b01988ed1154df261723ec60461cb6e62189984c62db",
+        firstPrivKey: "Y8k3XQRQrJoABEao4Sw45s744g6xth7yviNqFcN7zqPqKUJrrKTQ",
+    };
+    testNetwork(done, params);
+});
+it('Allows selection of Zcoin', function(done) {
+    var params = {
+        selectText: "XZC - Zcoin (rebranded to Firo)",
         phrase: "abandon abandon ability",
         firstAddress: "a6VcMdP4XgAA9Tr7xNszmPG5FZpfRf17Cq",
         firstPubKey: "0236f2348c32dc62d69488b01988ed1154df261723ec60461cb6e62189984c62db",
@@ -4978,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'))