zotero/test/tests/syncedSettingsTest.js
Adomas Ven 076bdadb29 Fixes feed sync bugs after conflicts. ()
SyncedSettings.set() caches values. If an object passed to set() is
modified after the call then get() returns that modified object.
2016-08-16 03:03:42 -04:00

10 lines
434 B
JavaScript

describe('Zotero.SyncedSettings', function() {
it('should not affect cached value when modifying the setting after #set() call', function* () {
let setting = {athing: 1};
yield Zotero.SyncedSettings.set(Zotero.Libraries.userLibraryID, 'setting', setting);
setting.athing = 2;
let storedSetting = Zotero.SyncedSettings.get(Zotero.Libraries.userLibraryID, 'setting');
assert.notDeepEqual(setting, storedSetting);
});
});