www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 57626101acadbc99169ce90b968a76ca19bdd3e7
parent 3ba2b40c4cf9b674bd887883a07432de81b15a43
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 24 Feb 2017 03:50:31 -0500

Fix incorrect tests due to the bug fixed in b21729edd17

Diffstat:
Mchrome/content/zotero/xpcom/sync/syncLocal.js | 6+-----
Mtest/tests/syncLocalTest.js | 4++++
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/chrome/content/zotero/xpcom/sync/syncLocal.js b/chrome/content/zotero/xpcom/sync/syncLocal.js @@ -183,11 +183,8 @@ Zotero.Sync.Data.Local = { var library = Zotero.Libraries.get(libraryID); // If library is going from editable to non-editable and there's unsynced local data, prompt - if (library.editable && !editable - && ((yield this._libraryHasUnsyncedData(libraryID)) - || (yield this._libraryHasUnsyncedFiles(libraryID)))) { + if (library.editable && !editable && (yield this._libraryHasUnsyncedData(libraryID))) { let index = Zotero.Sync.Data.Utilities.showWriteAccessLostPrompt(win, library); - // Reset library if (index == 0) { // This check happens before item data is loaded for syncing, so do it now, @@ -205,7 +202,6 @@ Zotero.Sync.Data.Local = { if (library.filesEditable && !filesEditable && (yield this._libraryHasUnsyncedFiles(libraryID))) { let index = Zotero.Sync.Storage.Utilities.showFileWriteAccessLostPrompt(win, library); - // Reset library files if (index == 0) { // This check happens before item data is loaded for syncing, so do it now, diff --git a/test/tests/syncLocalTest.js b/test/tests/syncLocalTest.js @@ -110,6 +110,7 @@ describe("Zotero.Sync.Data.Local", function() { }); var mock = sinon.mock(Zotero.Sync.Data.Local); + mock.expects("_libraryHasUnsyncedData").once().returns(Zotero.Promise.resolve(true)); mock.expects("resetUnsyncedLibraryData").once().returns(Zotero.Promise.resolve()); mock.expects("resetUnsyncedLibraryFiles").never(); @@ -130,6 +131,7 @@ describe("Zotero.Sync.Data.Local", function() { }, "cancel"); var mock = sinon.mock(Zotero.Sync.Data.Local); + mock.expects("_libraryHasUnsyncedData").once().returns(Zotero.Promise.resolve(true)); mock.expects("resetUnsyncedLibraryData").never(); mock.expects("resetUnsyncedLibraryFiles").never(); @@ -159,6 +161,7 @@ describe("Zotero.Sync.Data.Local", function() { }); var mock = sinon.mock(Zotero.Sync.Data.Local); + mock.expects("_libraryHasUnsyncedFiles").once().returns(Zotero.Promise.resolve(true)); mock.expects("resetUnsyncedLibraryData").never(); mock.expects("resetUnsyncedLibraryFiles").once().returns(Zotero.Promise.resolve()); @@ -179,6 +182,7 @@ describe("Zotero.Sync.Data.Local", function() { }, "cancel"); var mock = sinon.mock(Zotero.Sync.Data.Local); + mock.expects("_libraryHasUnsyncedFiles").once().returns(Zotero.Promise.resolve(true)); mock.expects("resetUnsyncedLibraryData").never(); mock.expects("resetUnsyncedLibraryFiles").never();