commit b3e14644f28d4ee9b5e3cdbbadde8917726ffe49
parent e8736178902146edb6f840cce7deb100d92008a2
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 17 Jan 2016 17:56:38 -0500
Fix sync tests
Diffstat:
2 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/test/tests/syncLocalTest.js b/test/tests/syncLocalTest.js
@@ -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;
diff --git a/test/tests/syncRunnerTest.js b/test/tests/syncRunnerTest.js
@@ -456,6 +456,15 @@ describe("Zotero.Sync.Runner", function () {
});
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",
status: 200,
headers: {
@@ -484,6 +493,15 @@ describe("Zotero.Sync.Runner", function () {
});
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",
status: 200,
headers: {
@@ -530,6 +548,15 @@ describe("Zotero.Sync.Runner", function () {
});
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",
status: 200,
headers: {
@@ -576,6 +603,15 @@ describe("Zotero.Sync.Runner", function () {
});
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",
status: 200,
headers: {