]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - tests/spec/tests.js
Adding TWINS coin support
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / tests / spec / tests.js
index b307f15031b88756088576ceafe86d555a2142f9..c92689a78c247e3e3e82c0a63321a3dba9e262b1 100644 (file)
@@ -73,16 +73,23 @@ else if (browser == "chrome") {
 
 // Helper functions
 
-function testNetwork(done, params) {
+function testNetwork(done, params, comparePub = false) {
     var phrase = params.phrase || 'abandon abandon ability';
     driver.findElement(By.css('.phrase'))
         .sendKeys(phrase);
     selectNetwork(params.selectText);
     driver.sleep(generateDelay).then(function() {
-        getFirstAddress(function(address) {
-            expect(address).toBe(params.firstAddress);
-            done();
-        });
+        if (!comparePub) {
+            getFirstAddress(function(address) {
+                expect(address).toBe(params.firstAddress);
+                done();
+            });
+        } else {
+            getFirstPublicKey(function(pubkey) {
+                expect(pubkey).toBe(params.firstPubKey);
+                done();
+            });
+        }
     });
 }
 
@@ -98,6 +105,10 @@ function getFirstAddress(handler) {
     getFirstRowValue(handler, ".address");
 }
 
+function getFirstPublicKey(handler) {
+    getFirstRowValue(handler, ".pubkey");
+}
+
 function getFirstPath(handler) {
     getFirstRowValue(handler, ".index");
 }
@@ -867,6 +878,13 @@ it('Allows selection of Einsteinium', function(done) {
     };
     testNetwork(done, params);
 });
+it('Allows selection of EOSIO', function(done) {
+    var params = {
+        selectText: "EOS - EOSIO",
+        firstPubKey: "EOS692VJTBK3Rmw93onNnpnZ8ZtmE9PdxjDStArvbyzoe11QUTNoy",
+    };
+    testNetowrk(done, params, true);
+});
 it('Allows selection of Europecoin', function(done) {
     var params = {
         selectText: "ERC - Europecoin",
@@ -1094,7 +1112,7 @@ it('Allows selection of Omnicore', function(done) {
 it('Allows selection of DeepOnion', function(done) {
     var params = {
         selectText: "ONION - DeepOnion",
-        firstAddress: "DVioZ2Rjc9krDf5bbHuixznSDumzvGpzVw",
+        firstAddress: "DYREY7XCFXVqJ3x5UuN43k2JwD2s1kif48",
     };
     testNetwork(done, params);
 });
@@ -1224,6 +1242,20 @@ it('Allows selection of Toa', function(done) {
     };
     testNetwork(done, params);
 });
+it('Allows selection of TWINS', function(done) {
+    var params = {
+        selectText: "TWINS - TWINS",
+        firstAddress: "WPpJnfLLubNmF7HLNxg8d8zH5haxn4wri8",
+    };
+    testNetwork(done, params);
+});
+it('Allows selection of TWINS testnet', function(done) {
+    var params = {
+        selectText: "TWINS - TWINS Testnet",
+        firstAddress: "XpnU1HHdNG5YxvG9Rez4wjmidchxqnZaNa",
+    };
+    testNetwork(done, params);
+});
 it('Allows selection of Ultimatesecurecash', function(done) {
     var params = {
         selectText: "USC - Ultimatesecurecash",