|
|
@@ -162,6 +162,7 @@ describe('ProjectHistoryRedisManager', function () {
|
|
|
},
|
|
|
version: this.version,
|
|
|
projectHistoryId: this.projectHistoryId,
|
|
|
+ createdBlob: false,
|
|
|
doc: this.doc_id,
|
|
|
}
|
|
|
|
|
|
@@ -207,6 +208,7 @@ describe('ProjectHistoryRedisManager', function () {
|
|
|
hash: '1337',
|
|
|
metadata,
|
|
|
projectHistoryId: this.projectHistoryId,
|
|
|
+ createdBlob: false,
|
|
|
file: fileId,
|
|
|
}
|
|
|
|
|
|
@@ -291,6 +293,7 @@ describe('ProjectHistoryRedisManager', function () {
|
|
|
},
|
|
|
version: this.version,
|
|
|
projectHistoryId: this.projectHistoryId,
|
|
|
+ createdBlob: false,
|
|
|
ranges: historyCompatibleRanges,
|
|
|
doc: this.doc_id,
|
|
|
}
|
|
|
@@ -343,6 +346,7 @@ describe('ProjectHistoryRedisManager', function () {
|
|
|
},
|
|
|
version: this.version,
|
|
|
projectHistoryId: this.projectHistoryId,
|
|
|
+ createdBlob: false,
|
|
|
doc: this.doc_id,
|
|
|
}
|
|
|
|
|
|
@@ -394,6 +398,68 @@ describe('ProjectHistoryRedisManager', function () {
|
|
|
},
|
|
|
version: this.version,
|
|
|
projectHistoryId: this.projectHistoryId,
|
|
|
+ createdBlob: false,
|
|
|
+ doc: this.doc_id,
|
|
|
+ }
|
|
|
+
|
|
|
+ this.ProjectHistoryRedisManager.promises.queueOps
|
|
|
+ .calledWithExactly(this.project_id, JSON.stringify(update))
|
|
|
+ .should.equal(true)
|
|
|
+ })
|
|
|
+
|
|
|
+ it('should pass "false" as the createdBlob field if not provided', async function () {
|
|
|
+ await this.ProjectHistoryRedisManager.promises.queueAddEntity(
|
|
|
+ this.project_id,
|
|
|
+ this.projectHistoryId,
|
|
|
+ 'doc',
|
|
|
+ this.doc_id,
|
|
|
+ this.user_id,
|
|
|
+ this.rawUpdate,
|
|
|
+ this.source
|
|
|
+ )
|
|
|
+
|
|
|
+ const update = {
|
|
|
+ pathname: this.pathname,
|
|
|
+ docLines: this.docLines,
|
|
|
+ meta: {
|
|
|
+ user_id: this.user_id,
|
|
|
+ ts: new Date(),
|
|
|
+ source: this.source,
|
|
|
+ },
|
|
|
+ version: this.version,
|
|
|
+ projectHistoryId: this.projectHistoryId,
|
|
|
+ createdBlob: false,
|
|
|
+ doc: this.doc_id,
|
|
|
+ }
|
|
|
+
|
|
|
+ this.ProjectHistoryRedisManager.promises.queueOps
|
|
|
+ .calledWithExactly(this.project_id, JSON.stringify(update))
|
|
|
+ .should.equal(true)
|
|
|
+ })
|
|
|
+
|
|
|
+ it('should pass through the value of the createdBlob field', async function () {
|
|
|
+ this.rawUpdate.createdBlob = true
|
|
|
+ await this.ProjectHistoryRedisManager.promises.queueAddEntity(
|
|
|
+ this.project_id,
|
|
|
+ this.projectHistoryId,
|
|
|
+ 'doc',
|
|
|
+ this.doc_id,
|
|
|
+ this.user_id,
|
|
|
+ this.rawUpdate,
|
|
|
+ this.source
|
|
|
+ )
|
|
|
+
|
|
|
+ const update = {
|
|
|
+ pathname: this.pathname,
|
|
|
+ docLines: this.docLines,
|
|
|
+ meta: {
|
|
|
+ user_id: this.user_id,
|
|
|
+ ts: new Date(),
|
|
|
+ source: this.source,
|
|
|
+ },
|
|
|
+ version: this.version,
|
|
|
+ projectHistoryId: this.projectHistoryId,
|
|
|
+ createdBlob: true,
|
|
|
doc: this.doc_id,
|
|
|
}
|
|
|
|