From 50fa9609a3783e83760a7fb445b20c4b19c68486 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 2 Aug 2021 11:01:30 +0100 Subject: [PATCH] add test of archive status --- .../js/GettingDocsFromArchiveTest.js | 67 ++++++++++--------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/services/docstore/test/acceptance/js/GettingDocsFromArchiveTest.js b/services/docstore/test/acceptance/js/GettingDocsFromArchiveTest.js index 2bf2605bec..4f3465c698 100644 --- a/services/docstore/test/acceptance/js/GettingDocsFromArchiveTest.js +++ b/services/docstore/test/acceptance/js/GettingDocsFromArchiveTest.js @@ -113,40 +113,41 @@ describe('Getting A Doc from Archive', function () { ) }) - describe('for an non-archived doc', function () { - before(function (done) { - this.project_id = ObjectId() - this.timeout(1000 * 30) - this.doc = { - _id: ObjectId(), - lines: ['foo', 'bar'], - ranges: {}, - version: 2, - } - DocstoreClient.createDoc( - this.project_id, - this.doc._id, - this.doc.lines, - this.doc.version, - this.doc.ranges, - done - ) - }) - - it('should return the doc lines and version from mongo', function (done) { - return DocstoreClient.peekDoc( - this.project_id, - this.doc._id, - {}, - (error, res, doc) => { - res.statusCode.should.equal(200) - res.headers['x-doc-status'].should.equal('active') - doc.lines.should.deep.equal(this.doc.lines) - doc.version.should.equal(this.doc.version) - doc.ranges.should.deep.equal(this.doc.ranges) - return done() + describe('for an non-archived doc', function () { + before(function (done) { + this.project_id = ObjectId() + this.timeout(1000 * 30) + this.doc = { + _id: ObjectId(), + lines: ['foo', 'bar'], + ranges: {}, + version: 2, } - ) + DocstoreClient.createDoc( + this.project_id, + this.doc._id, + this.doc.lines, + this.doc.version, + this.doc.ranges, + done + ) + }) + + it('should return the doc lines and version from mongo', function (done) { + return DocstoreClient.peekDoc( + this.project_id, + this.doc._id, + {}, + (error, res, doc) => { + res.statusCode.should.equal(200) + res.headers['x-doc-status'].should.equal('active') + doc.lines.should.deep.equal(this.doc.lines) + doc.version.should.equal(this.doc.version) + doc.ranges.should.deep.equal(this.doc.ranges) + return done() + } + ) + }) }) }) })