more profileConfig rename

This commit is contained in:
Girish Ramakrishnan
2022-01-13 15:20:16 -08:00
parent e9945d8010
commit 97e439f8a3
5 changed files with 49 additions and 36 deletions
+6 -6
View File
@@ -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
});