it('Allows selection of bitcoin cash', function(done) {
var params = {
selectText: "BCH - Bitcoin Cash",
- firstAddress: "1JKvb6wKtsjNoCRxpZ4DGrbniML7z5U16A",
+ firstAddress: "bitcoincash:qzlquk7w4hkudxypl4fgv8x279r754dkvur7jpcsps",
};
testNetwork(done, params);
});
};
testNetwork(done, params);
});
+it('Allows selection of Bitcoin Private', function(done) {
+ var params = {
+ selectText: "BTCP - Bitcoin Private",
+ firstAddress: "b1M3PbiXXyN6Hdivdw5rJv5VKpLjPzhm4jM",
+ };
+ testNetwork(done, params);
+});
+it('Allows selection of Bitcoinz', function(done) {
+ var params = {
+ selectText: "BTCZ - Bitcoinz",
+ firstAddress: "t1X2YQoxs8cYRo2oaBYgVEwW5QNjCC59NYc",
+ };
+ testNetwork(done, params);
+});
it('Allows selection of Bitcore', function(done) {
var params = {
selectText: "BTX - Bitcore",
};
testNetwork(done, params);
});
+it('Allows selection of Kobocoin', function(done) {
+ var params = {
+ selectText: "KOBO - Kobocoin",
+ firstAddress: "FTVoNJETXDAM8x7MnmdE8RwWndSr9PQWhy",
+ };
+ testNetwork(done, params);
+});
it('Allows selection of Landcoin', function(done) {
var params = {
selectText: "LDCN - Landcoin",
};
testNetwork(done, params);
});
+it('Allows selection of Zcash', function(done) {
+ var params = {
+ selectText: "ZEC - Zcash",
+ firstAddress: "t1Sz8AneMcVuzUg3tPJ8et5AS5LFJ7K2EF9",
+ };
+ testNetwork(done, params);
+});
+it('Allows selection of Zclassic', function(done) {
+ var params = {
+ selectText: "ZCL - Zclassic",
+ firstAddress: "t1TBMxTvVJRybUbMLGWq8H4A8F4VUL7czEc",
+ };
+ testNetwork(done, params);
+});
+it('Allows selection of Zencash', function(done) {
+ var params = {
+ selectText: "ZEN - Zencash",
+ firstAddress: "znWh9XASyW2dZq5tck84wFjiwuqVysi7q3p",
+ };
+ testNetwork(done, params);
+});
+it('Allows selection of Energi', function(done) {
+ var params = {
+ selectText: "NRG - Energi",
+ firstAddress: "EejRy4t4nidzhGGzkJUgFP3z4HYBjhTsRt",
+ };
+ testNetwork(done, params);
+});
// BIP39 seed is set from phrase
});
});
+// Bitcoin Cash address can be set to use cashaddr format
+it('Can use cashaddr format for bitcoin cash addresses', function(done) {
+ driver.executeScript(function() {
+ $(".use-bch-cashaddr-addresses").prop("checked", true);
+ });
+ driver.findElement(By.css('.phrase'))
+ .sendKeys("abandon abandon ability");
+ selectNetwork("BCH - Bitcoin Cash");
+ driver.sleep(generateDelay).then(function() {
+ getFirstAddress(function(address) {
+ expect(address).toBe("bitcoincash:qzlquk7w4hkudxypl4fgv8x279r754dkvur7jpcsps");
+ done();
+ });
+ });
+});
+
// Bitcoin Cash address can be set to use bitpay format
it('Can use bitpay format for bitcoin cash addresses', function(done) {
driver.executeScript(function() {
- $(".use-bitpay-addresses").prop("checked", true);
+ $(".use-bch-bitpay-addresses").prop("checked", true);
});
driver.findElement(By.css('.phrase'))
.sendKeys("abandon abandon ability");
});
});
+// Bitcoin Cash address can be set to use legacy format
+it('Can use legacy format for bitcoin cash addresses', function(done) {
+ driver.executeScript(function() {
+ $(".use-bch-legacy-addresses").prop("checked", true);
+ });
+ driver.findElement(By.css('.phrase'))
+ .sendKeys("abandon abandon ability");
+ selectNetwork("BCH - Bitcoin Cash");
+ driver.sleep(generateDelay).then(function() {
+ getFirstAddress(function(address) {
+ expect(address).toBe("1JKvb6wKtsjNoCRxpZ4DGrbniML7z5U16A");
+ done();
+ });
+ });
+});
+
// End of tests ported from old suit, so no more comments above each test now
it('Can generate more addresses from a custom index', function(done) {
});
});
+it('Shows a warning if generating weak mnemonics', function(done) {
+ driver.executeScript(function() {
+ $(".strength option[selected]").removeAttr("selected");
+ $(".strength option[value=6]").prop("selected", true);
+ $(".strength").trigger("change");
+ });
+ driver.findElement(By.css(".generate-container .warning"))
+ .getAttribute("class")
+ .then(function(classes) {
+ expect(classes).not.toContain("hidden");
+ done();
+ });
+});
+
+it('Does not show a warning if generating strong mnemonics', function(done) {
+ driver.executeScript(function() {
+ $(".strength option[selected]").removeAttr("selected");
+ $(".strength option[value=12]").prop("selected", true);
+ });
+ driver.findElement(By.css(".generate-container .warning"))
+ .getAttribute("class")
+ .then(function(classes) {
+ expect(classes).toContain("hidden");
+ done();
+ });
+});
+
+it('Shows a warning if overriding weak entropy with longer mnemonics', function(done) {
+ driver.findElement(By.css('.use-entropy'))
+ .click();
+ driver.findElement(By.css('.entropy'))
+ .sendKeys("0123456789abcdef"); // 6 words
+ driver.executeScript(function() {
+ $(".mnemonic-length").val("12").trigger("change");
+ });
+ driver.findElement(By.css(".weak-entropy-override-warning"))
+ .getAttribute("class")
+ .then(function(classes) {
+ expect(classes).not.toContain("hidden");
+ done();
+ });
+});
+
+it('Does not show a warning if entropy is stronger than mnemonic length', function(done) {
+ driver.findElement(By.css('.use-entropy'))
+ .click();
+ driver.findElement(By.css('.entropy'))
+ .sendKeys("0123456789abcdef0123456789abcdef0123456789abcdef"); // 18 words
+ driver.executeScript(function() {
+ $(".mnemonic-length").val("12").trigger("change");
+ });
+ driver.findElement(By.css(".weak-entropy-override-warning"))
+ .getAttribute("class")
+ .then(function(classes) {
+ expect(classes).toContain("hidden");
+ done();
+ });
+});
+
});