Move state enums to the model code

This commit is contained in:
Girish Ramakrishnan
2019-08-30 13:12:49 -07:00
parent b4cbf63519
commit dd0fb8292c
15 changed files with 118 additions and 156 deletions

View File

@@ -1,5 +1,6 @@
/* global it:false */
/* global describe:false */
/* global xdescribe:false */
/* global before:false */
/* global after:false */
@@ -366,9 +367,9 @@ describe('Apps', function () {
xdescribe('configureInstalledApps', function () {
before(function (done) {
async.series([
appdb.update.bind(null, APP_0.id, { installationState: appdb.ISTATE_INSTALLED }),
appdb.update.bind(null, APP_1.id, { installationState: appdb.ISTATE_ERROR }),
appdb.update.bind(null, APP_2.id, { installationState: appdb.ISTATE_INSTALLED })
appdb.update.bind(null, APP_0.id, { installationState: apps.ISTATE_INSTALLED }),
appdb.update.bind(null, APP_1.id, { installationState: apps.ISTATE_ERROR }),
appdb.update.bind(null, APP_2.id, { installationState: apps.ISTATE_INSTALLED })
], done);
});
@@ -377,9 +378,9 @@ describe('Apps', function () {
expect(error).to.be(null);
apps.getAll(function (error, apps) {
expect(apps[0].installationState).to.be(appdb.ISTATE_PENDING_CONFIGURE);
expect(apps[1].installationState).to.be(appdb.ISTATE_PENDING_CONFIGURE); // erorred app can be reconfigured after restore
expect(apps[2].installationState).to.be(appdb.ISTATE_PENDING_CONFIGURE);
expect(apps[0].installationState).to.be(apps.ISTATE_PENDING_CONFIGURE);
expect(apps[1].installationState).to.be(apps.ISTATE_PENDING_CONFIGURE); // erorred app can be reconfigured after restore
expect(apps[2].installationState).to.be(apps.ISTATE_PENDING_CONFIGURE);
done();
});
@@ -390,9 +391,9 @@ describe('Apps', function () {
xdescribe('restoreInstalledApps', function () {
before(function (done) {
async.series([
appdb.update.bind(null, APP_0.id, { installationState: appdb.ISTATE_INSTALLED }),
appdb.update.bind(null, APP_1.id, { installationState: appdb.ISTATE_ERROR }),
appdb.update.bind(null, APP_2.id, { installationState: appdb.ISTATE_INSTALLED })
appdb.update.bind(null, APP_0.id, { installationState: apps.ISTATE_INSTALLED }),
appdb.update.bind(null, APP_1.id, { installationState: apps.ISTATE_ERROR }),
appdb.update.bind(null, APP_2.id, { installationState: apps.ISTATE_INSTALLED })
], done);
});
@@ -401,9 +402,9 @@ describe('Apps', function () {
expect(error).to.be(null);
apps.getAll(function (error, result) {
expect(result[0].installationState).to.be(appdb.ISTATE_PENDING_RESTORE);
expect(result[1].installationState).to.be(appdb.ISTATE_PENDING_RESTORE);
expect(result[2].installationState).to.be(appdb.ISTATE_PENDING_RESTORE);
expect(result[0].installationState).to.be(apps.ISTATE_PENDING_RESTORE);
expect(result[1].installationState).to.be(apps.ISTATE_PENDING_RESTORE);
expect(result[2].installationState).to.be(apps.ISTATE_PENDING_RESTORE);
done();
});