]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - tests/spec/tests.js
Add ZooBC address format
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / tests / spec / tests.js
index f0b50e7cfde4752280ed5795824a0ea3f12dea79..ca5b1bbc2e496bfbbe2f6fb27dce75a1927e245e 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
@@ -2317,6 +2328,17 @@ it('Allows selection of TRX on Tron', function(done) {
     testNetwork(done, params);
 });
 
+it('Allows selection of ZooBlockchain', function(done) {
+    var params = {
+        selectText: "ZBC - ZooBlockchain",
+        phrase: "shy invest oxygen real lunar moral merge corn program air affair amazing dove imitate combine solve library fresh case alcohol pole question act thing",
+        firstAddress: "ZBC_MGEZVH3U_SXPCBHTU_KSWDPQ4X_K6MSI3VR_CQAYMTLC_RXUMM3DJ_LFABCAXA",
+        firstPubKey: "61899a9f7495de209e7454ac37c3975799246eb11401864d628de8c66c695940",
+        firstPrivKey: "adb11e79068fa7366ec4f5963ad57115d666b1ad2b369b92d962563adf7dd48b",
+    };
+    testNetwork(done, params);
+});
+
 // BIP39 seed is set from phrase
 it('Sets the bip39 seed from the prhase', function(done) {
     driver.findElement(By.css('.phrase'))
@@ -4988,6 +5010,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'))