move config route under dashboard

it's essentially giving info for various parts of the ui
This commit is contained in:
Girish Ramakrishnan
2023-08-12 21:47:24 +05:30
parent 070f6e5de3
commit 68a3c267e5
10 changed files with 67 additions and 58 deletions

View File

@@ -7,12 +7,10 @@
'use strict';
const constants = require('../constants.js'),
database = require('../database.js'),
expect = require('expect.js'),
safe = require('safetydance'),
server = require('../server.js'),
superagent = require('superagent'),
util = require('util');
superagent = require('superagent');
const SERVER_URL = 'http://localhost:' + constants.PORT;
@@ -64,12 +62,12 @@ describe('Server', function () {
after(server.stop);
it('config fails due missing token', async function () {
const response = await superagent.get(SERVER_URL + '/api/v1/config').ok(() => true);
const response = await superagent.get(SERVER_URL + '/api/v1/dashboard/config').ok(() => true);
expect(response.statusCode).to.equal(401);
});
it('config fails due wrong token', async function () {
const response = await superagent.get(SERVER_URL + '/api/v1/config').query({ access_token: 'somewrongtoken' }).ok(() => true);
const response = await superagent.get(SERVER_URL + '/api/v1/dashboard/config').query({ access_token: 'somewrongtoken' }).ok(() => true);
expect(response.status).to.equal(401);
});
});