Add mailbox test

This commit is contained in:
Girish Ramakrishnan
2019-09-09 15:58:58 -07:00
parent 5f9b2f1159
commit d8cb100fc0
3 changed files with 89 additions and 4 deletions

View File

@@ -983,8 +983,7 @@ function setDebugMode(appId, debugMode, auditSource, callback) {
function setMailbox(appId, mailboxName, auditSource, callback) {
assert.strictEqual(typeof appId, 'string');
assert(!mailboxName || typeof mailboxName === 'string');
assert.strictEqual(typeof memoryLimit, 'number');
assert(mailboxName === null || typeof mailboxName === 'string');
assert.strictEqual(typeof auditSource, 'object');
assert.strictEqual(typeof callback, 'function');
@@ -998,7 +997,7 @@ function setMailbox(appId, mailboxName, auditSource, callback) {
mailboxName = mailboxNameForLocation(app.location, app.manifest);
}
scheduleTask(appId, {}, { installationState: exports.ISTATE_PENDING_CREATE, mailboxName: mailboxName }, function (error, result) {
scheduleTask(appId, {}, { installationState: exports.ISTATE_PENDING_CREATE_CONTAINER, mailboxName: mailboxName }, function (error, result) {
if (error) return callback(error);
eventlog.add(eventlog.ACTION_APP_CONFIGURE, auditSource, { appId: appId, app: app, mailboxName: mailboxName, taskId: result.taskId });
@@ -1132,6 +1131,9 @@ function setLocation(appId, data, auditSource, callback) {
values.alternateDomains = data.alternateDomains;
}
// move the mailbox name to match the new location
if (app.mailboxName.endsWith('.app')) values.mailboxName = mailboxNameForLocation(values.location, app.manifest);
domains.get(values.domain, function (error, domainObject) {
if (error && error.reason === DomainsError.NOT_FOUND) return callback(new AppsError(AppsError.NOT_FOUND, 'No such domain'));
if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, 'Could not get domain info:' + error.message));