diff options
author | Ian Coleman <ian@iancoleman.io> | 2019-12-17 13:42:44 +1100 |
---|---|---|
committer | Ian Coleman <ian@iancoleman.io> | 2019-12-17 14:10:45 +1100 |
commit | 516c16d721db88b4b2c39964e2d5e8f6310c7bff (patch) | |
tree | ca4d1e8742d46715892adabe5003396819d7d12b /tests | |
parent | f7e9fdf002e7355a122a86a8407b470b56bf3f59 (diff) | |
download | BIP39-516c16d721db88b4b2c39964e2d5e8f6310c7bff.tar.gz BIP39-516c16d721db88b4b2c39964e2d5e8f6310c7bff.tar.zst BIP39-516c16d721db88b4b2c39964e2d5e8f6310c7bff.zip |
Allow manual override for entropy type
Diffstat (limited to 'tests')
-rw-r--r-- | tests/spec/tests.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/spec/tests.js b/tests/spec/tests.js index bbc1f57..bdc5909 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js | |||
@@ -4285,4 +4285,48 @@ it('Shows split prase cards', function(done) { | |||
4285 | }); | 4285 | }); |
4286 | }); | 4286 | }); |
4287 | 4287 | ||
4288 | // It allows manually specifying the entropy type | ||
4289 | it('Allows entropy type to be manually selected', function(done) { | ||
4290 | driver.findElement(By.css('.use-entropy')) | ||
4291 | .click(); | ||
4292 | // use decimal entropy | ||
4293 | driver.findElement(By.css('.entropy')) | ||
4294 | .sendKeys("91"); | ||
4295 | // manually change to binary entropy | ||
4296 | driver.executeScript(function() { | ||
4297 | $(".entropy-container input[value='binary']").click(); | ||
4298 | }); | ||
4299 | driver.sleep(entropyFeedbackDelay).then(function() { | ||
4300 | driver.findElement(By.css('.entropy-container')) | ||
4301 | .getText() | ||
4302 | .then(function(text) { | ||
4303 | // overide 91 to be just 1 | ||
4304 | var key = "Filtered Entropy"; | ||
4305 | var value = "1"; | ||
4306 | var reText = key + "\\s+" + value; | ||
4307 | var re = new RegExp(reText); | ||
4308 | expect(text).toMatch(re); | ||
4309 | // overide automatic decimal to binary | ||
4310 | var key = "Entropy Type"; | ||
4311 | var value = "binary"; | ||
4312 | var reText = key + "\\s+" + value; | ||
4313 | var re = new RegExp(reText); | ||
4314 | expect(text).toMatch(re); | ||
4315 | // overide 2 events to 1 | ||
4316 | var key = "Event Count"; | ||
4317 | var value = 1; | ||
4318 | var reText = key + "\\s+" + value; | ||
4319 | var re = new RegExp(reText); | ||
4320 | expect(text).toMatch(re); | ||
4321 | // overide log2(10)*2 bits to 1 bit | ||
4322 | var key = "Total Bits"; | ||
4323 | var value = 1; | ||
4324 | var reText = key + "\\s+" + value; | ||
4325 | var re = new RegExp(reText); | ||
4326 | expect(text).toMatch(re); | ||
4327 | done(); | ||
4328 | }); | ||
4329 | }); | ||
4330 | }); | ||
4331 | |||
4288 | }); | 4332 | }); |