Fixup tests
This commit is contained in:
@@ -15,7 +15,7 @@ describe('Backups API', function () {
|
||||
|
||||
const newTarget = {
|
||||
provider: 'filesystem',
|
||||
label: 'NewTarget',
|
||||
name: 'NewTarget',
|
||||
config: { backupDir: '/tmp/boxtest-newtarget' },
|
||||
format: 'tgz',
|
||||
retention: { keepWithinSecs: 60 * 60 },
|
||||
@@ -24,7 +24,7 @@ describe('Backups API', function () {
|
||||
|
||||
const encryptedTarget = {
|
||||
provider: 'filesystem',
|
||||
label: 'EncryptedTarget',
|
||||
name: 'EncryptedTarget',
|
||||
config: { backupDir: '/tmp/boxtest-enctarget' },
|
||||
format: 'rsync',
|
||||
retention: { keepMonthly: 60 },
|
||||
@@ -74,7 +74,7 @@ describe('Backups API', function () {
|
||||
expect(tmp.provider).to.be(newTarget.provider);
|
||||
expect(tmp.config).to.be.ok();
|
||||
expect(tmp.format).to.be(newTarget.format);
|
||||
expect(tmp.label).to.be(newTarget.label);
|
||||
expect(tmp.name).to.be(newTarget.name);
|
||||
expect(tmp.primary).to.be(false);
|
||||
});
|
||||
});
|
||||
@@ -87,7 +87,7 @@ describe('Backups API', function () {
|
||||
expect(response.body.provider).to.be(newTarget.provider);
|
||||
expect(response.body.config).to.be.ok();
|
||||
expect(response.body.format).to.be(newTarget.format);
|
||||
expect(response.body.label).to.be(newTarget.label);
|
||||
expect(response.body.name).to.be(newTarget.name);
|
||||
expect(response.body.primary).to.be(false);
|
||||
});
|
||||
|
||||
@@ -98,7 +98,7 @@ describe('Backups API', function () {
|
||||
expect(response.body.provider).to.be(encryptedTarget.provider);
|
||||
expect(response.body.config).to.be.ok();
|
||||
expect(response.body.format).to.be(encryptedTarget.format);
|
||||
expect(response.body.label).to.be(encryptedTarget.label);
|
||||
expect(response.body.name).to.be(encryptedTarget.name);
|
||||
expect(response.body.primary).to.be(false);
|
||||
expect(response.body.encrypted).to.be(true);
|
||||
expect(response.body.encryptedFilenames).to.be(true);
|
||||
|
||||
@@ -117,16 +117,6 @@ async function setupServer() {
|
||||
await database.initialize();
|
||||
await database._clear();
|
||||
await appstore._setApiServerOrigin(exports.mockApiServerOrigin);
|
||||
// duplicated here since we clear the database
|
||||
const id = await backupTargets.add({
|
||||
provider: 'filesystem',
|
||||
label: 'Default',
|
||||
config: { backupDir: '/tmp/boxtest' },
|
||||
format: 'tgz',
|
||||
retention: { keepWithinSecs: 2 * 24 * 60 * 60 },
|
||||
schedule: '00 00 23 * * *'
|
||||
}, exports.auditSource);
|
||||
await backupTargets.setPrimary({ id }, exports.auditSource);
|
||||
await oidcServer.stop();
|
||||
await server.start();
|
||||
debug('Set up server complete');
|
||||
@@ -244,6 +234,6 @@ async function waitForAsyncTask(es) {
|
||||
}
|
||||
|
||||
async function getDefaultBackupTarget() {
|
||||
const result = await backupTargets.list(1, 1);
|
||||
return result[0];
|
||||
const result = await backupTargets.list(1, 10);
|
||||
return result.find(r => r.name === 'Default');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user