Fix incorrect tests due to the bug fixed in b21729edd1

This commit is contained in:
Dan Stillman 2017-02-24 03:50:31 -05:00
parent 3ba2b40c4c
commit 57626101ac
2 changed files with 5 additions and 5 deletions
chrome/content/zotero/xpcom/sync
test/tests

View file

@ -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,

View file

@ -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();