Fix backup tests

This commit is contained in:
Girish Ramakrishnan
2020-06-14 14:01:01 -07:00
parent e3829eb24b
commit 2601d2945d
2 changed files with 22 additions and 12 deletions

View File

@@ -1327,7 +1327,8 @@ describe('database', function () {
id: 'backup-box',
encryptionVersion: 2,
packageVersion: '1.0.0',
type: backups.BACKUP_TYPE__BOX,
type: backups.BACKUP_TYPE_BOX,
state: backups.BACKUP_STATE_NORMAL,
identifier: 'box',
dependsOn: [ 'dep1' ],
manifest: null,
@@ -1345,7 +1346,8 @@ describe('database', function () {
expect(error).to.be(null);
expect(result.encryptionVersion).to.be(2);
expect(result.packageVersion).to.be('1.0.0');
expect(result.type).to.be(backups.BACKUP_TYPE__BOX);
expect(result.type).to.be(backups.BACKUP_TYPE_BOX);
expect(result.state).to.be(backups.BACKUP_STATE_NORMAL);
expect(result.creationTime).to.be.a(Date);
expect(result.dependsOn).to.eql(['dep1']);
expect(result.manifest).to.eql(null);
@@ -1363,7 +1365,7 @@ describe('database', function () {
});
it('getByTypePaged succeeds', function (done) {
backupdb.getByTypePaged(backups.BACKUP_TYPE__BOX, 1, 5, function (error, results) {
backupdb.getByTypePaged(backups.BACKUP_TYPE_BOX, 1, 5, function (error, results) {
expect(error).to.be(null);
expect(results).to.be.an(Array);
expect(results.length).to.be(1);
@@ -1397,7 +1399,8 @@ describe('database', function () {
id: 'app_appid_123',
encryptionVersion: null,
packageVersion: '1.0.0',
type: backups.BACKUP_TYPE__APP,
type: backups.BACKUP_TYPE_APP,
state: backups.BACKUP_STATE_CREATING,
identifier: 'appid',
dependsOn: [ ],
manifest: { foo: 'bar' },
@@ -1415,7 +1418,8 @@ describe('database', function () {
expect(error).to.be(null);
expect(result.encryptionVersion).to.be(null);
expect(result.packageVersion).to.be('1.0.0');
expect(result.type).to.be(backups.BACKUP_TYPE__APP);
expect(result.type).to.be(backups.BACKUP_TYPE_APP);
expect(result.state).to.be(backups.BACKUP_STATE_CREATING);
expect(result.creationTime).to.be.a(Date);
expect(result.dependsOn).to.eql([]);
expect(result.manifest).to.eql({ foo: 'bar' });
@@ -1423,8 +1427,8 @@ describe('database', function () {
});
});
it('getByAppIdPaged succeeds', function (done) {
backupdb.getByAppIdPaged(1, 5, 'appid', function (error, results) {
it('getByIdentifierPaged succeeds', function (done) {
backupdb.getByIdentifierPaged('appid', 1, 5, function (error, results) {
expect(error).to.be(null);
expect(results).to.be.an(Array);
expect(results.length).to.be(1);