Skip to content

Commit

Permalink
Merge branch 'bugfix/ARSN-361/file_backend_inf_vid' into tmp/octopus/…
Browse files Browse the repository at this point in the history
…w/7.70/bugfix/ARSN-361/file_backend_inf_vid
  • Loading branch information
bert-e committed Aug 15, 2023
2 parents d4c4164 + bbd926b commit 35b467e
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tests/unit/versioning/VersioningRequestProcessor.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const assert = require('assert');
const async = require('async');
const { getInfVid } = require('../../../lib/versioning/VersionID');

const Version = require('../../../lib/versioning/Version').Version;

Expand Down Expand Up @@ -254,6 +255,55 @@ describe('test VRP', () => {
}],
done);
});

it('should update master if a infinite versionId is passed and the master does not have a versionId', done => {
async.waterfall([next => {
const request = {
db: 'foo',
key: 'bar',
value: '{"qux":"quz"}',
options: { versioning: false },
};
vsp.put(request, logger, next);
},
(res, next) => {
// should overwrite the master
const request = {
db: 'foo',
key: 'bar',
value: '{"qux":"quz2"}',
options: { versioning: true, versionId: getInfVid('PARIS') },
};
vsp.put(request, logger, next);
},
(_, next) => {
// fetch master
const request = {
db: 'foo',
key: 'bar',
};
vsp.get(request, logger, next);
},
(res, next) => {
// check that master has been updated
assert.strictEqual(JSON.parse(res).qux, 'quz2');
next();
},
(next) => {
// check that the version is accessible
const request = {
db: 'foo',
key: 'bar',
versionId: getInfVid('PARIS'),
};
vsp.get(request, logger, next);
},
(res, next) => {
assert.strictEqual(JSON.parse(res).qux, 'quz2');
next();
}],
done);
});
});


Expand Down

0 comments on commit 35b467e

Please sign in to comment.