Fix sync tests

This commit is contained in:
Dan Stillman 2016-01-17 17:56:38 -05:00
parent e873617890
commit b3e14644f2
2 changed files with 48 additions and 0 deletions

View file

@ -23,6 +23,11 @@ describe("Zotero.Sync.Data.Local", function() {
describe("#getLatestCacheObjectVersions", function () {
before(function* () {
yield resetDB({
thisArg: this,
skipBundledFiles: true
});
yield Zotero.Sync.Data.Local.saveCacheObjects(
'item',
Zotero.Libraries.userLibraryID,
@ -87,6 +92,13 @@ describe("Zotero.Sync.Data.Local", function() {
describe("#processSyncCacheForObjectType()", function () {
var types = Zotero.DataObjectUtilities.getTypes();
before(function* () {
yield resetDB({
thisArg: this,
skipBundledFiles: true
});
})
it("should update local version number and mark as synced if remote version is identical", function* () {
var libraryID = Zotero.Libraries.userLibraryID;

View file

@ -454,6 +454,15 @@ describe("Zotero.Sync.Runner", function () {
},
json: []
});
setResponse({
method: "GET",
url: "users/1/items/top?format=versions&includeTrashed=1",
status: 200,
headers: {
"Last-Modified-Version": 5
},
json: []
});
setResponse({
method: "GET",
url: "users/1/items?format=versions&includeTrashed=1",
@ -482,6 +491,15 @@ describe("Zotero.Sync.Runner", function () {
},
json: []
});
setResponse({
method: "GET",
url: "users/1/publications/items/top?format=versions&includeTrashed=1",
status: 200,
headers: {
"Last-Modified-Version": 10
},
json: []
});
setResponse({
method: "GET",
url: "users/1/publications/items?format=versions&includeTrashed=1",
@ -528,6 +546,15 @@ describe("Zotero.Sync.Runner", function () {
},
json: []
});
setResponse({
method: "GET",
url: "groups/1623562/items/top?format=versions&includeTrashed=1",
status: 200,
headers: {
"Last-Modified-Version": 15
},
json: []
});
setResponse({
method: "GET",
url: "groups/1623562/items?format=versions&includeTrashed=1",
@ -574,6 +601,15 @@ describe("Zotero.Sync.Runner", function () {
},
json: []
});
setResponse({
method: "GET",
url: "groups/2694172/items/top?format=versions&includeTrashed=1",
status: 200,
headers: {
"Last-Modified-Version": 20
},
json: []
});
setResponse({
method: "GET",
url: "groups/2694172/items?format=versions&includeTrashed=1",