backups: query using identifier instead of type

this allows us to move the enums into backups.js instead of backupdb.js
This commit is contained in:
Girish Ramakrishnan
2020-06-14 12:19:51 -07:00
parent 4f964101a0
commit f6cb1a0863
6 changed files with 63 additions and 72 deletions
+9 -9
View File
@@ -165,7 +165,7 @@ describe('backups', function () {
identifier: 'box',
encryptionVersion: null,
packageVersion: '1.0.0',
type: backupdb.BACKUP_TYPE_BOX,
type: backups.BACKUP_TYPE__BOX,
dependsOn: [ 'backup-app-00', 'backup-app-01' ],
manifest: null,
format: 'tgz'
@@ -176,7 +176,7 @@ describe('backups', function () {
identifier: 'app0',
encryptionVersion: null,
packageVersion: '1.0.0',
type: backupdb.BACKUP_TYPE_APP,
type: backups.BACKUP_TYPE_APP,
dependsOn: [],
manifest: null,
format: 'tgz'
@@ -187,7 +187,7 @@ describe('backups', function () {
identifier: 'app1',
encryptionVersion: null,
packageVersion: '1.0.0',
type: backupdb.BACKUP_TYPE_APP,
type: backups.BACKUP_TYPE_APP,
dependsOn: [],
manifest: null,
format: 'tgz'
@@ -197,7 +197,7 @@ describe('backups', function () {
id: 'backup-box-1',
encryptionVersion: null,
packageVersion: '1.0.0',
type: backupdb.BACKUP_TYPE_BOX,
type: backups.BACKUP_TYPE_BOX,
identifier: 'box',
dependsOn: [ 'backup-app-10', 'backup-app-11' ],
manifest: null,
@@ -208,7 +208,7 @@ describe('backups', function () {
id: 'backup-app-10',
encryptionVersion: null,
packageVersion: '1.0.0',
type: backupdb.BACKUP_TYPE_APP,
type: backups.BACKUP_TYPE_APP,
identifier: 'app0',
dependsOn: [],
manifest: null,
@@ -219,7 +219,7 @@ describe('backups', function () {
id: 'backup-app-11',
encryptionVersion: null,
packageVersion: '1.0.0',
type: backupdb.BACKUP_TYPE_APP,
type: backups.BACKUP_TYPE_APP,
identifier: 'app1',
dependsOn: [],
manifest: null,
@@ -242,7 +242,7 @@ describe('backups', function () {
cleanupBackups(function (error) {
expect(error).to.not.be.ok();
backupdb.getByTypePaged(backupdb.BACKUP_TYPE_BOX, 1, 1000, function (error, result) {
backupdb.getByTypePaged(backups.BACKUP_TYPE__BOX, 1, 1000, function (error, result) {
expect(error).to.not.be.ok();
expect(result.length).to.equal(1);
expect(result[0].id).to.equal(BACKUP_1.id);
@@ -263,7 +263,7 @@ describe('backups', function () {
cleanupBackups(function (error) {
expect(error).to.not.be.ok();
backupdb.getByTypePaged(backupdb.BACKUP_TYPE_BOX, 1, 1000, function (error, result) {
backupdb.getByTypePaged(backups.BACKUP_TYPE__BOX, 1, 1000, function (error, result) {
expect(error).to.not.be.ok();
expect(result.length).to.equal(1);
expect(result[0].id).to.equal(BACKUP_1.id);
@@ -288,7 +288,7 @@ describe('backups', function () {
cleanupBackups(function (error) {
expect(error).to.not.be.ok();
backupdb.getByTypePaged(backupdb.BACKUP_TYPE_APP, 1, 1000, function (error, result) {
backupdb.getByTypePaged(backups.BACKUP_TYPE__APP, 1, 1000, function (error, result) {
expect(error).to.not.be.ok();
expect(result.length).to.equal(2);