Fix incorrect tests due to the bug fixed in b21729edd1
This commit is contained in:
parent
3ba2b40c4c
commit
57626101ac
|
@ -183,11 +183,8 @@ Zotero.Sync.Data.Local = {
|
||||||
var library = Zotero.Libraries.get(libraryID);
|
var library = Zotero.Libraries.get(libraryID);
|
||||||
|
|
||||||
// If library is going from editable to non-editable and there's unsynced local data, prompt
|
// If library is going from editable to non-editable and there's unsynced local data, prompt
|
||||||
if (library.editable && !editable
|
if (library.editable && !editable && (yield this._libraryHasUnsyncedData(libraryID))) {
|
||||||
&& ((yield this._libraryHasUnsyncedData(libraryID))
|
|
||||||
|| (yield this._libraryHasUnsyncedFiles(libraryID)))) {
|
|
||||||
let index = Zotero.Sync.Data.Utilities.showWriteAccessLostPrompt(win, library);
|
let index = Zotero.Sync.Data.Utilities.showWriteAccessLostPrompt(win, library);
|
||||||
|
|
||||||
// Reset library
|
// Reset library
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
// This check happens before item data is loaded for syncing, so do it now,
|
// 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))) {
|
if (library.filesEditable && !filesEditable && (yield this._libraryHasUnsyncedFiles(libraryID))) {
|
||||||
let index = Zotero.Sync.Storage.Utilities.showFileWriteAccessLostPrompt(win, library);
|
let index = Zotero.Sync.Storage.Utilities.showFileWriteAccessLostPrompt(win, library);
|
||||||
|
|
||||||
// Reset library files
|
// Reset library files
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
// This check happens before item data is loaded for syncing, so do it now,
|
// This check happens before item data is loaded for syncing, so do it now,
|
||||||
|
|
|
@ -110,6 +110,7 @@ describe("Zotero.Sync.Data.Local", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
var mock = sinon.mock(Zotero.Sync.Data.Local);
|
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("resetUnsyncedLibraryData").once().returns(Zotero.Promise.resolve());
|
||||||
mock.expects("resetUnsyncedLibraryFiles").never();
|
mock.expects("resetUnsyncedLibraryFiles").never();
|
||||||
|
|
||||||
|
@ -130,6 +131,7 @@ describe("Zotero.Sync.Data.Local", function() {
|
||||||
}, "cancel");
|
}, "cancel");
|
||||||
|
|
||||||
var mock = sinon.mock(Zotero.Sync.Data.Local);
|
var mock = sinon.mock(Zotero.Sync.Data.Local);
|
||||||
|
mock.expects("_libraryHasUnsyncedData").once().returns(Zotero.Promise.resolve(true));
|
||||||
mock.expects("resetUnsyncedLibraryData").never();
|
mock.expects("resetUnsyncedLibraryData").never();
|
||||||
mock.expects("resetUnsyncedLibraryFiles").never();
|
mock.expects("resetUnsyncedLibraryFiles").never();
|
||||||
|
|
||||||
|
@ -159,6 +161,7 @@ describe("Zotero.Sync.Data.Local", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
var mock = sinon.mock(Zotero.Sync.Data.Local);
|
var mock = sinon.mock(Zotero.Sync.Data.Local);
|
||||||
|
mock.expects("_libraryHasUnsyncedFiles").once().returns(Zotero.Promise.resolve(true));
|
||||||
mock.expects("resetUnsyncedLibraryData").never();
|
mock.expects("resetUnsyncedLibraryData").never();
|
||||||
mock.expects("resetUnsyncedLibraryFiles").once().returns(Zotero.Promise.resolve());
|
mock.expects("resetUnsyncedLibraryFiles").once().returns(Zotero.Promise.resolve());
|
||||||
|
|
||||||
|
@ -179,6 +182,7 @@ describe("Zotero.Sync.Data.Local", function() {
|
||||||
}, "cancel");
|
}, "cancel");
|
||||||
|
|
||||||
var mock = sinon.mock(Zotero.Sync.Data.Local);
|
var mock = sinon.mock(Zotero.Sync.Data.Local);
|
||||||
|
mock.expects("_libraryHasUnsyncedFiles").once().returns(Zotero.Promise.resolve(true));
|
||||||
mock.expects("resetUnsyncedLibraryData").never();
|
mock.expects("resetUnsyncedLibraryData").never();
|
||||||
mock.expects("resetUnsyncedLibraryFiles").never();
|
mock.expects("resetUnsyncedLibraryFiles").never();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user