Make tests pass
This commit is contained in:
@@ -45,6 +45,7 @@ describe('Directory Server API', function () {
|
||||
|
||||
it('cannot set directory_server config without secret', async function () {
|
||||
let tmp = JSON.parse(JSON.stringify(defaultConfig));
|
||||
tmp.enabled = true;
|
||||
delete tmp.secret;
|
||||
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/directory_server/config`)
|
||||
@@ -103,5 +104,18 @@ describe('Directory Server API', function () {
|
||||
expect(response.statusCode).to.equal(200);
|
||||
expect(response.body).to.eql({ enabled: true, secret: 'ldapsecret', allowlist: '1.2.3.4' });
|
||||
});
|
||||
|
||||
// keep this last. this ensures directory server is stopped and the tests can exit
|
||||
it('can disable directory_server config', async function () {
|
||||
let tmp = JSON.parse(JSON.stringify(defaultConfig));
|
||||
tmp.enabled = false;
|
||||
tmp.secret = 'ldapsecret';
|
||||
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/directory_server/config`)
|
||||
.query({ access_token: owner.token })
|
||||
.send(tmp);
|
||||
|
||||
expect(response.statusCode).to.equal(200);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user