Fix some typos

This commit is contained in:
Girish Ramakrishnan
2020-08-19 22:40:04 -07:00
parent 81d0637483
commit 2d50f10fd6
3 changed files with 24 additions and 29 deletions

View File

@@ -33,6 +33,8 @@ var USER_0 = {
permissions: null
};
const ADMIN_DOMAIN = 'updatechecker-test.example.com';
const DOMAIN_0 = {
domain: 'example.com',
zoneName: 'example.com',
@@ -78,11 +80,12 @@ describe('updatechecker - box - manual (email)', function () {
database.initialize,
database._clear,
settings._setApiServerOrigin.bind(null, 'http://localhost:4444'),
settings.setAdminLocation.bind(null, ADMIN_DOMAIN, 'my.' + ADMIN_DOMAIN),
cron.startJobs,
domains.add.bind(null, DOMAIN_0.domain, DOMAIN_0, AUDIT_SOURCE),
settings.setAdminLocation.bind(null, DOMAIN_0.domain, 'my.' + DOMAIN_0.domain),
users.createOwner.bind(null, USER_0.username, USER_0.password, USER_0.email, USER_0.displayName, AUDIT_SOURCE),
settings.setBoxAutoupdatePattern.bind(null, constants.AUTOUPDATE_PATTERN_NEVER),
settings.setAutoupdatePattern.bind(null, constants.AUTOUPDATE_PATTERN_NEVER),
settingsdb.set.bind(null, settings.CLOUDRON_TOKEN_KEY, 'atoken'),
], done);
});
@@ -252,7 +255,7 @@ describe('updatechecker - app - manual (email)', function () {
settings.setAdminLocation.bind(null, DOMAIN_0.domain, 'my.' + DOMAIN_0.domain),
users.createOwner.bind(null, USER_0.username, USER_0.password, USER_0.email, USER_0.displayName, AUDIT_SOURCE),
appdb.add.bind(null, APP_0.id, APP_0.appStoreId, APP_0.manifest, APP_0.location, APP_0.domain, apps._translatePortBindings(APP_0.portBindings, APP_0.manifest), APP_0),
settings.setAppAutoupdatePattern.bind(null, constants.AUTOUPDATE_PATTERN_NEVER),
settings.setAutoupdatePattern.bind(null, constants.AUTOUPDATE_PATTERN_NEVER),
settingsdb.set.bind(null, settings.CLOUDRON_TOKEN_KEY, 'atoken'),
], done);
});
@@ -267,7 +270,7 @@ describe('updatechecker - app - manual (email)', function () {
.query({ boxVersion: constants.VERSION, accessToken: 'atoken', appId: APP_0.appStoreId, appVersion: APP_0.manifest.version, automatic: false })
.reply(204, { } );
updatechecker.checkAppUpdates({ automatic: false }, function (error) {
updatechecker._checkAppUpdates({ automatic: false }, function (error) {
expect(!error).to.be.ok();
expect(updatechecker.getUpdateInfo().apps).to.eql({});
expect(scope.isDone()).to.be.ok();
@@ -284,7 +287,7 @@ describe('updatechecker - app - manual (email)', function () {
.query({ boxVersion: constants.VERSION, accessToken: 'atoken', appId: APP_0.appStoreId, appVersion: APP_0.manifest.version, automatic: false })
.reply(500, { update: { manifest: { version: '1.0.0', changelog: '* some changes' } } } );
updatechecker.checkAppUpdates({ automatic: false }, function (error) {
updatechecker._checkAppUpdates({ automatic: false }, function (error) {
expect(!error).to.be.ok();
expect(updatechecker.getUpdateInfo().apps).to.eql({});
expect(scope.isDone()).to.be.ok();
@@ -301,7 +304,7 @@ describe('updatechecker - app - manual (email)', function () {
.query({ boxVersion: constants.VERSION, accessToken: 'atoken', appId: APP_0.appStoreId, appVersion: APP_0.manifest.version, automatic: false })
.reply(200, { manifest: { version: '2.0.0', changelog: '* some changes' } } );
updatechecker.checkAppUpdates({ automatic: false }, function (error) {
updatechecker._checkAppUpdates({ automatic: false }, function (error) {
expect(!error).to.be.ok();
expect(updatechecker.getUpdateInfo().apps).to.eql({ 'appid-0': { manifest: { version: '2.0.0', changelog: '* some changes' }, unstable: false } });
expect(scope.isDone()).to.be.ok();
@@ -313,7 +316,7 @@ describe('updatechecker - app - manual (email)', function () {
it('does not offer old version', function (done) {
nock.cleanAll();
updatechecker.checkAppUpdates({ automatic: false }, function (error) {
updatechecker._checkAppUpdates({ automatic: false }, function (error) {
expect(!error).to.be.ok();
expect(updatechecker.getUpdateInfo().apps).to.eql({ });
checkMails(0, done);
@@ -361,7 +364,7 @@ describe('updatechecker - app - automatic (no email)', function () {
settings.setAdminLocation.bind(null, DOMAIN_0.domain, 'my.' + DOMAIN_0.domain),
users.createOwner.bind(null, USER_0.username, USER_0.password, USER_0.email, USER_0.displayName, AUDIT_SOURCE),
appdb.add.bind(null, APP_0.id, APP_0.appStoreId, APP_0.manifest, APP_0.location, APP_0.domain, apps._translatePortBindings(APP_0.portBindings, APP_0.manifest), APP_0),
settings.setAppAutoupdatePattern.bind(null, '00 00 1,3,5,23 * * *'),
settings.setAutoupdatePattern.bind(null, '00 00 1,3,5,23 * * *'),
settingsdb.set.bind(null, settings.CLOUDRON_TOKEN_KEY, 'atoken'),
], done);
});
@@ -376,7 +379,7 @@ describe('updatechecker - app - automatic (no email)', function () {
.query({ boxVersion: constants.VERSION, accessToken: 'atoken', appId: APP_0.appStoreId, appVersion: APP_0.manifest.version, automatic: false })
.reply(200, { manifest: { version: '2.0.0', changelog: 'c' } } );
updatechecker.checkAppUpdates({ automatic: false }, function (error) {
updatechecker._checkAppUpdates({ automatic: false }, function (error) {
expect(!error).to.be.ok();
expect(updatechecker.getUpdateInfo().apps).to.eql({ 'appid-0': { manifest: { version: '2.0.0', changelog: 'c' }, unstable: false } });
expect(scope.isDone()).to.be.ok();
@@ -426,7 +429,7 @@ describe('updatechecker - app - automatic free (email)', function () {
settings.setAdminLocation.bind(null, DOMAIN_0.domain, 'my.' + DOMAIN_0.domain),
users.createOwner.bind(null, USER_0.username, USER_0.password, USER_0.email, USER_0.displayName, AUDIT_SOURCE),
appdb.add.bind(null, APP_0.id, APP_0.appStoreId, APP_0.manifest, APP_0.location, APP_0.domain, apps._translatePortBindings(APP_0.portBindings, APP_0.manifest), APP_0),
settings.setAppAutoupdatePattern.bind(null, '00 00 1,3,5,23 * * *'),
settings.setAutoupdatePattern.bind(null, '00 00 1,3,5,23 * * *'),
settingsdb.set.bind(null, settings.CLOUDRON_TOKEN_KEY, 'atoken'),
], done);
});
@@ -441,7 +444,7 @@ describe('updatechecker - app - automatic free (email)', function () {
.query({ boxVersion: constants.VERSION, accessToken: 'atoken', appId: APP_0.appStoreId, appVersion: APP_0.manifest.version, automatic: false })
.reply(200, { manifest: { version: '2.0.0', changelog: 'c' } } );
updatechecker.checkAppUpdates({ automatic: false }, function (error) {
updatechecker._checkAppUpdates({ automatic: false }, function (error) {
expect(!error).to.be.ok();
expect(updatechecker.getUpdateInfo().apps).to.eql({ 'appid-0': { manifest: { version: '2.0.0', changelog: 'c' }, unstable: false } });
expect(scope.isDone()).to.be.ok();