aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-06-17 08:34:44 +0800
committerDan Finlay <dan@danfinlay.com>2016-06-17 08:34:44 +0800
commit451be3b10e4550d80cf11c73f38e879d13a15e3d (patch)
treefb1c1fb3099bd650a4a5501f9b3ced44e045596b /test
parentfe83a19c0847b8d4ca051bbd4d37e13d9d7bdd39 (diff)
parentbdb113fabe9091b195d70f7f61246b6647b3b0a4 (diff)
downloadtangerine-wallet-browser-451be3b10e4550d80cf11c73f38e879d13a15e3d.tar
tangerine-wallet-browser-451be3b10e4550d80cf11c73f38e879d13a15e3d.tar.gz
tangerine-wallet-browser-451be3b10e4550d80cf11c73f38e879d13a15e3d.tar.bz2
tangerine-wallet-browser-451be3b10e4550d80cf11c73f38e879d13a15e3d.tar.lz
tangerine-wallet-browser-451be3b10e4550d80cf11c73f38e879d13a15e3d.tar.xz
tangerine-wallet-browser-451be3b10e4550d80cf11c73f38e879d13a15e3d.tar.zst
tangerine-wallet-browser-451be3b10e4550d80cf11c73f38e879d13a15e3d.zip
Merge branch 'master' into SignFullDataNotHash
Diffstat (limited to 'test')
-rw-r--r--test/unit/config-manager-test.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/test/unit/config-manager-test.js b/test/unit/config-manager-test.js
index aa94dc385..130bde2ff 100644
--- a/test/unit/config-manager-test.js
+++ b/test/unit/config-manager-test.js
@@ -4,11 +4,41 @@ var configManager
describe('config-manager', function() {
- before(function() {
+ beforeEach(function() {
window.localStorage = {} // Hacking localStorage support into JSDom
configManager = new ConfigManager()
})
+ describe('confirmation', function() {
+
+ describe('#getConfirmed', function() {
+ it('should return false if no previous key exists', function() {
+ var result = configManager.getConfirmed()
+ assert.ok(!result)
+ })
+ })
+
+ describe('#setConfirmed', function() {
+ it('should make getConfirmed return true once set', function() {
+ configManager.setConfirmed(true)
+ var result = configManager.getConfirmed()
+ assert.equal(result, true)
+ })
+
+ it('should be able to set false', function() {
+ configManager.setConfirmed(false)
+ var result = configManager.getConfirmed()
+ assert.equal(result, false)
+ })
+
+ it('should persist to local storage', function() {
+ configManager.setConfirmed(true)
+ var data = configManager.getData()
+ assert.equal(data.isConfirmed, true)
+ })
+ })
+ })
+
describe('#setConfig', function() {
window.localStorage = {} // Hacking localStorage support into JSDom