diff options
| author | Stephen Blott | 2014-04-19 15:17:43 +0100 |
|---|---|---|
| committer | Stephen Blott | 2014-04-19 15:17:43 +0100 |
| commit | a9cec9742115a098a031ae7f946eb7bb93648ecd (patch) | |
| tree | 629c1e9967feb1660228a486197558fa27d03a5f /tests | |
| parent | 4083ee6423c10c34c1d0a3fa48e8f4d79c8615df (diff) | |
| download | vimium-a9cec9742115a098a031ae7f946eb7bb93648ecd.tar.bz2 | |
Add a couple more test cases for Sync.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit_tests/settings_test.coffee | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit_tests/settings_test.coffee b/tests/unit_tests/settings_test.coffee index 5d24c7f2..dd2815f0 100644 --- a/tests/unit_tests/settings_test.coffee +++ b/tests/unit_tests/settings_test.coffee @@ -78,3 +78,16 @@ context "settings", chrome.storage.sync.set { scrollStepSize: JSON.stringify(40) } chrome.storage.sync.remove 'scrollStepSize' assert.isFalse Settings.has 'scrollStepSize' + + should "trigger a postUpdateHook", -> + message = "Hello World" + # Install a bogus update hook for an existing setting. + Settings.postUpdateHooks['scrollStepSize'] = (value) -> Sync.message = value + chrome.storage.sync.set { scrollStepSize: JSON.stringify(message) } + # Was the update hook triggered? + assert.equal message, Sync.message + + should "sync a key which is not a setting", -> + # There is nothing to test, here. It's purpose is just to ensure that, should additional settings be + # added in future, then the Sync won't cause unexpected crashes. + chrome.storage.sync.set { notASetting: JSON.stringify("notAUsefullValue") } |
