more profileConfig rename
This commit is contained in:
@@ -66,18 +66,18 @@ describe('Settings', function () {
|
||||
expect(enabled).to.be(true);
|
||||
});
|
||||
|
||||
it('can get default directory config', async function () {
|
||||
const directoryConfig = await settings.getDirectoryConfig();
|
||||
expect(directoryConfig.lockUserProfiles).to.be(false);
|
||||
expect(directoryConfig.mandatory2FA).to.be(false);
|
||||
it('can get default profile config', async function () {
|
||||
const profileConfig = await settings.getProfileConfig();
|
||||
expect(profileConfig.lockUserProfiles).to.be(false);
|
||||
expect(profileConfig.mandatory2FA).to.be(false);
|
||||
});
|
||||
|
||||
it('can set default directory config', async function () {
|
||||
it('can set default profile config', async function () {
|
||||
await tokens.add({ name: 'token1', identifier: admin.id, clientId: tokens.ID_WEBADMIN, expires: Number.MAX_SAFE_INTEGER, lastUsedTime: null, scope: 'unused' });
|
||||
let result = await tokens.listByUserId(admin.id);
|
||||
expect(result.length).to.be(1); // just confirm the token was really added!
|
||||
|
||||
await settings.setDirectoryConfig({ mandatory2FA: true, lockUserProfiles: true });
|
||||
await settings.setProfileConfig({ mandatory2FA: true, lockUserProfiles: true });
|
||||
result = await tokens.listByUserId(admin.id);
|
||||
expect(result.length).to.be(0); // should have been removed by mandatory 2fa setting change
|
||||
});
|
||||
|
||||
@@ -226,10 +226,10 @@ describe('User', function () {
|
||||
expect(error.message).to.equal('email already exists');
|
||||
});
|
||||
|
||||
it('can update the user with already existing username', async function () {
|
||||
it('cannot update username', async function () {
|
||||
const [error] = await safe(users.update(admin, { username: user.username }, auditSource));
|
||||
expect(error.reason).to.be(BoxError.ALREADY_EXISTS);
|
||||
expect(error.message).to.equal('username already exists');
|
||||
expect(error.reason).to.be(BoxError.CONFLICT);
|
||||
expect(error.message).to.equal('Username cannot be changed');
|
||||
});
|
||||
|
||||
it('can update the user', async function () {
|
||||
|
||||
Reference in New Issue
Block a user