2021-02-23 08:57:27 -05:00
|
|
|
const { expect } = require('chai')
|
|
|
|
const { ObjectId } = require('../../../app/js/mongodb')
|
|
|
|
|
|
|
|
const TrackChangesApp = require('./helpers/TrackChangesApp')
|
|
|
|
const TrackChangesClient = require('./helpers/TrackChangesClient')
|
|
|
|
|
|
|
|
describe('ExportProject', function () {
|
|
|
|
before('start app', function (done) {
|
|
|
|
TrackChangesApp.ensureRunning(done)
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('when there are no updates', function () {
|
|
|
|
before('fetch export', function (done) {
|
2021-02-25 04:52:54 -05:00
|
|
|
TrackChangesClient.exportProject(
|
|
|
|
ObjectId(),
|
|
|
|
(error, updates, userIds) => {
|
|
|
|
if (error) {
|
|
|
|
return done(error)
|
|
|
|
}
|
|
|
|
this.exportedUpdates = updates
|
|
|
|
this.exportedUserIds = userIds
|
|
|
|
done()
|
2021-02-23 08:57:27 -05:00
|
|
|
}
|
2021-02-25 04:52:54 -05:00
|
|
|
)
|
2021-02-23 08:57:27 -05:00
|
|
|
})
|
|
|
|
|
|
|
|
it('should export an empty array', function () {
|
|
|
|
expect(this.exportedUpdates).to.deep.equal([])
|
2021-02-25 04:52:54 -05:00
|
|
|
expect(this.exportedUserIds).to.deep.equal([])
|
2021-02-23 08:57:27 -05:00
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
// see ArchivingUpdatesTests for tests with data in mongo/s3
|
|
|
|
})
|