fix various users-test.js

This commit is contained in:
Girish Ramakrishnan
2021-07-19 12:43:30 -07:00
parent 48585e003d
commit 6e9b62dfba
4 changed files with 634 additions and 902 deletions

View File

@@ -73,7 +73,8 @@ const ADMIN = {
groupIds: [],
role: 'owner',
source: '',
avatar: constants.AVATAR_GRAVATAR
avatar: constants.AVATAR_GRAVATAR,
active: true,
};
const USER = {
@@ -90,7 +91,8 @@ const USER = {
displayName: '',
source: '',
permissions: null,
avatar: constants.AVATAR_NONE
avatar: constants.AVATAR_NONE,
active: true,
};
const APP = {
@@ -113,6 +115,7 @@ const APP = {
exports = module.exports = {
createTree,
domainSetup,
setup,
cleanup,
@@ -156,7 +159,7 @@ function createTree(root, obj) {
createSubTree(obj, root);
}
function setup(done) {
function domainSetup(done) {
nock.cleanAll();
async.series([
@@ -167,6 +170,12 @@ function setup(done) {
settings.initCache,
blobs.initSecrets,
domains.add.bind(null, DOMAIN.domain, DOMAIN, AUDIT_SOURCE),
], done);
}
function setup(done) {
async.series([
domainSetup,
async function createOwner() {
const result = await users.createOwner(ADMIN.email, ADMIN.username, ADMIN.password, ADMIN.displayName, AUDIT_SOURCE);
ADMIN.id = result.id;
@@ -193,3 +202,4 @@ function cleanup(done) {
database.uninitialize
], done);
}

File diff suppressed because it is too large Load Diff