settings: move support config to support

This commit is contained in:
Girish Ramakrishnan
2023-08-02 22:21:30 +05:30
parent eb4213d61d
commit fccc2d04a9
8 changed files with 62 additions and 33 deletions
+28
View File
@@ -83,6 +83,34 @@ describe('Support API', function () {
});
});
describe('config', function () {
it('normal user cannot get config', async function () {
const response = await superagent.get(`${serverUrl}/api/v1/support/config`)
.query({ access_token: user.token })
.ok(() => true);
expect(response.statusCode).to.equal(403);
});
it('admin also cannot get config', async function () {
const response = await superagent.get(`${serverUrl}/api/v1/support/config`)
.query({ access_token: admin.token })
.ok(() => true);
expect(response.statusCode).to.equal(403);
});
it('owner can get config', async function () {
const response = await superagent.get(`${serverUrl}/api/v1/support/config`)
.query({ access_token: owner.token });
expect(response.statusCode).to.equal(200);
expect(response.body.email).to.be('support@cloudron.io');
expect(response.body.remoteSupport).to.be(true);
expect(response.body.submitTickets).to.be(true);
});
});
describe('ticket', function () {
it('fails without token', async function () {
const response = await superagent.post(`${serverUrl}/api/v1/support/ticket`)