From 64f290465aa14478200dc266ccc68b3475352e69 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 19 Apr 2014 08:08:03 +0100 Subject: Add tests for sync. --- tests/unit_tests/settings_test.coffee | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/unit_tests/settings_test.coffee b/tests/unit_tests/settings_test.coffee index 36a54f11..57766c12 100644 --- a/tests/unit_tests/settings_test.coffee +++ b/tests/unit_tests/settings_test.coffee @@ -30,3 +30,15 @@ context "settings", Settings.set 'scrollStepSize', 20 Settings.clear 'scrollStepSize' assert.equal Settings.get('scrollStepSize'), 60 + + should "remote changes take effect locally, non-default value", -> + Settings.set 'scrollStepSize', 20 + assert.equal Settings.get('scrollStepSize'), 20 + Sync.listener { scrollStepSize: { newValue: "40" } } + assert.equal Settings.get('scrollStepSize'), 40 + + should "remote changes take effect locally, default value", -> + Settings.set 'scrollStepSize', 20 + assert.equal Settings.get('scrollStepSize'), 20 + Sync.listener { scrollStepSize: { newValue: "60" } } + assert.isFalse Settings.has 'scrollStepSize' -- cgit v1.2.3