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:
@@ -28,6 +28,7 @@ describe('Archives', function () {
|
||||
format: 'tgz',
|
||||
preserveSecs: 0,
|
||||
label: '',
|
||||
appConfig: { loc: 'loc1' }
|
||||
};
|
||||
|
||||
before(async function () {
|
||||
@@ -36,16 +37,15 @@ describe('Archives', function () {
|
||||
});
|
||||
after(cleanup);
|
||||
|
||||
const appConfig = { loc: 'loc1' };
|
||||
let archiveId;
|
||||
|
||||
it('cannot add bad backup to archives', async function () {
|
||||
const [error] = await safe(archives.add('badId', { appConfig }, auditSource));
|
||||
const [error] = await safe(archives.add('badId', {}, auditSource));
|
||||
expect(error.reason).to.be(BoxError.NOT_FOUND);
|
||||
});
|
||||
|
||||
it('can add good backup to archives', async function () {
|
||||
archiveId = await archives.add(appBackup.id, { appConfig }, auditSource);
|
||||
archiveId = await archives.add(appBackup.id, {}, auditSource);
|
||||
});
|
||||
|
||||
it('cannot get invalid archive', async function () {
|
||||
@@ -55,14 +55,14 @@ describe('Archives', function () {
|
||||
|
||||
it('can get archive', async function () {
|
||||
const result = await archives.get(archiveId);
|
||||
expect(result.appConfig).to.eql(appConfig);
|
||||
expect(result.appConfig).to.eql(appBackup.appConfig);
|
||||
});
|
||||
|
||||
it('can list archives', async function () {
|
||||
const result = await archives.list(1, 100);
|
||||
expect(result.length).to.be(1);
|
||||
expect(result[0].id).to.be(archiveId);
|
||||
expect(result[0].appConfig).to.eql(appConfig);
|
||||
expect(result[0].appConfig).to.eql(appBackup.appConfig);
|
||||
});
|
||||
|
||||
it('can list backupIds', async function () {
|
||||
|
||||
Reference in New Issue
Block a user