backup: move appConfig to backups table
this is useful for clone also to copy notes, operators, checklist of the time when the backup was made (as opposed to current) at this point, it's not clear why we need a archives table. it's an optimization to not have to store icon for every backup.
This commit is contained in:
@@ -27,15 +27,15 @@ describe('Archives API', function () {
|
||||
format: 'tgz',
|
||||
preserveSecs: 0,
|
||||
label: '',
|
||||
appConfig: { loc: 'loc1' }
|
||||
};
|
||||
|
||||
const appConfig = { loc: 'loc1' };
|
||||
let archiveId;
|
||||
|
||||
before(async function () {
|
||||
await setup();
|
||||
appBackup.id = await backups.add(appBackup);
|
||||
archiveId = await archives.add(appBackup.id, { appConfig }, auditSource);
|
||||
archiveId = await archives.add(appBackup.id, {}, auditSource);
|
||||
});
|
||||
after(cleanup);
|
||||
|
||||
@@ -45,13 +45,14 @@ describe('Archives API', function () {
|
||||
expect(response.statusCode).to.equal(200);
|
||||
expect(response.body.archives.length).to.be(1);
|
||||
expect(response.body.archives[0].id).to.be(archiveId);
|
||||
expect(response.body.archives[0].appConfig).to.eql(appBackup.appConfig);
|
||||
});
|
||||
|
||||
it('get valid archive', async function () {
|
||||
const response = await superagent.get(`${serverUrl}/api/v1/archives/${archiveId}`)
|
||||
.query({ access_token: owner.token });
|
||||
expect(response.statusCode).to.equal(200);
|
||||
expect(response.body.appConfig).to.eql(appConfig);
|
||||
expect(response.body.appConfig).to.eql(appBackup.appConfig);
|
||||
});
|
||||
|
||||
it('cannot get invalid archive', async function () {
|
||||
|
||||
Reference in New Issue
Block a user