From 13d0c3dd63c3368bdb2971c0abcfd0db44229338 Mon Sep 17 00:00:00 2001 From: Bruno Michel Date: Mon, 24 Apr 2017 14:21:54 +0200 Subject: [PATCH] Fix Merge tests --- src/merge.js | 2 +- test/unit/merge.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/merge.js b/src/merge.js index eb89dbc9e..e5db76244 100644 --- a/src/merge.js +++ b/src/merge.js @@ -180,7 +180,7 @@ class Merge { if (doc.size == null) { doc.size = file.size } if (doc.class == null) { doc.class = file.class } if (doc.mime == null) { doc.mime = file.mime } - } else if (!isUpToDate(side, doc)) { + } else if (!isUpToDate(side, file)) { return this.resolveConflictAsync(side, doc) } if (sameFile(file, doc)) { diff --git a/test/unit/merge.js b/test/unit/merge.js index 595b2499f..ff9778e3c 100644 --- a/test/unit/merge.js +++ b/test/unit/merge.js @@ -146,7 +146,11 @@ describe('Merge', function () { path: 'FIZZBUZZ.JPG', docType: 'file', md5sum: '3333333333333333333333333333333333333333', - tags: ['qux', 'quux'] + tags: ['qux', 'quux'], + sides: { + local: 2, + remote: 2 + } } this.merge.updateFileAsync(this.side, clone(doc)).then(() => { this.pouch.db.get(this.file._id, function (err, res) {