Fix backup tests
This commit is contained in:
@@ -35,7 +35,7 @@ function createBackup(callback) {
|
||||
if (p.errorMessage) return callback(new Error('backup failed:' + p));
|
||||
if (!p.result) return callback(new Error('backup has no result:' + p));
|
||||
|
||||
backups.getByStatePaged(backupdb.BACKUP_STATE_NORMAL, 1, 1, function (error, result) {
|
||||
backups.getByIdentifierAndStatePaged(backups.BACKUP_IDENTIFIER_BOX, backups.BACKUP_STATE_NORMAL, 1, 1, function (error, result) {
|
||||
if (error) return callback(error);
|
||||
if (result.length !== 1) return callback(new Error('result is not of length 1'));
|
||||
|
||||
@@ -165,7 +165,8 @@ describe('backups', function () {
|
||||
identifier: 'box',
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backups.BACKUP_TYPE__BOX,
|
||||
type: backups.BACKUP_TYPE_BOX,
|
||||
state: backups.BACKUP_STATE_NORMAL,
|
||||
dependsOn: [ 'backup-app-00', 'backup-app-01' ],
|
||||
manifest: null,
|
||||
format: 'tgz'
|
||||
@@ -177,6 +178,7 @@ describe('backups', function () {
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backups.BACKUP_TYPE_APP,
|
||||
state: backups.BACKUP_STATE_NORMAL,
|
||||
dependsOn: [],
|
||||
manifest: null,
|
||||
format: 'tgz'
|
||||
@@ -188,6 +190,7 @@ describe('backups', function () {
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backups.BACKUP_TYPE_APP,
|
||||
state: backups.BACKUP_STATE_NORMAL,
|
||||
dependsOn: [],
|
||||
manifest: null,
|
||||
format: 'tgz'
|
||||
@@ -198,6 +201,7 @@ describe('backups', function () {
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backups.BACKUP_TYPE_BOX,
|
||||
state: backups.BACKUP_STATE_NORMAL,
|
||||
identifier: 'box',
|
||||
dependsOn: [ 'backup-app-10', 'backup-app-11' ],
|
||||
manifest: null,
|
||||
@@ -209,6 +213,7 @@ describe('backups', function () {
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backups.BACKUP_TYPE_APP,
|
||||
state: backups.BACKUP_STATE_NORMAL,
|
||||
identifier: 'app0',
|
||||
dependsOn: [],
|
||||
manifest: null,
|
||||
@@ -220,6 +225,7 @@ describe('backups', function () {
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backups.BACKUP_TYPE_APP,
|
||||
state: backups.BACKUP_STATE_NORMAL,
|
||||
identifier: 'app1',
|
||||
dependsOn: [],
|
||||
manifest: null,
|
||||
@@ -242,7 +248,7 @@ describe('backups', function () {
|
||||
cleanupBackups(function (error) {
|
||||
expect(error).to.not.be.ok();
|
||||
|
||||
backupdb.getByTypePaged(backups.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 +269,7 @@ describe('backups', function () {
|
||||
cleanupBackups(function (error) {
|
||||
expect(error).to.not.be.ok();
|
||||
|
||||
backupdb.getByTypePaged(backups.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 +294,7 @@ describe('backups', function () {
|
||||
cleanupBackups(function (error) {
|
||||
expect(error).to.not.be.ok();
|
||||
|
||||
backupdb.getByTypePaged(backups.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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user