aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit_tests/settings_test.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests/settings_test.coffee')
-rw-r--r--tests/unit_tests/settings_test.coffee29
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/unit_tests/settings_test.coffee b/tests/unit_tests/settings_test.coffee
index b2c5484b..040de285 100644
--- a/tests/unit_tests/settings_test.coffee
+++ b/tests/unit_tests/settings_test.coffee
@@ -1,30 +1,33 @@
require "./test_helper.js"
+require "./test_chrome_stubs.js"
extend(global, require "../../lib/utils.js")
Utils.getCurrentVersion = -> '1.44'
global.localStorage = {}
-{Settings} = require "../../background_scripts/settings.js"
+
+extend(global,require "../../background_scripts/sync.js")
+extend(global,require "../../background_scripts/settings.js")
context "settings",
setup ->
stub global, 'localStorage', {}
- should "obtain defaults if no key is stored", ->
- assert.isFalse Settings.has 'scrollStepSize'
- assert.equal Settings.get('scrollStepSize'), 60
+should "obtain defaults if no key is stored", ->
+ assert.isFalse Settings.has 'scrollStepSize'
+ assert.equal Settings.get('scrollStepSize'), 60
should "store values", ->
Settings.set 'scrollStepSize', 20
assert.equal Settings.get('scrollStepSize'), 20
- should "not store values equal to the default", ->
- Settings.set 'scrollStepSize', 20
- assert.isTrue Settings.has 'scrollStepSize'
- Settings.set 'scrollStepSize', 60
- assert.isFalse Settings.has 'scrollStepSize'
+should "not store values equal to the default", ->
+ Settings.set 'scrollStepSize', 20
+ assert.isTrue Settings.has 'scrollStepSize'
+ Settings.set 'scrollStepSize', 60
+ assert.isFalse Settings.has 'scrollStepSize'
- should "revert to defaults if no key is stored", ->
- Settings.set 'scrollStepSize', 20
- Settings.clear 'scrollStepSize'
- assert.equal Settings.get('scrollStepSize'), 60
+should "revert to defaults if no key is stored", ->
+ Settings.set 'scrollStepSize', 20
+ Settings.clear 'scrollStepSize'
+ assert.equal Settings.get('scrollStepSize'), 60