test: add missing controllers

isekai-main
Barış Soner Uşaklı 3 years ago
parent edf7c647e8
commit bc120dba68

@ -81,12 +81,29 @@ describe('Admin Controllers', () => {
it('should load admin dashboard', (done) => { it('should load admin dashboard', (done) => {
groups.join('administrators', adminUid, (err) => { groups.join('administrators', adminUid, (err) => {
assert.ifError(err); assert.ifError(err);
request(`${nconf.get('url')}/admin`, { jar: jar }, (err, res, body) => { const dashboards = [
assert.ifError(err); '/admin', '/admin/dashboard/logins', '/admin/dashboard/users', '/admin/dashboard/topics', '/admin/dashboard/searches',
assert.equal(res.statusCode, 200); ];
assert(body); async.each(dashboards, (url, next) => {
done(); request(`${nconf.get('url')}${url}`, { jar: jar }, (err, res, body) => {
}); assert.ifError(err);
assert.equal(res.statusCode, 200, url);
assert(body);
next();
});
}, done);
});
});
it('should load admin analytics', (done) => {
request(`${nconf.get('url')}/api/admin/analytics?units=hours`, { jar: jar, json: true }, (err, res, body) => {
assert.ifError(err);
assert.equal(res.statusCode, 200);
assert(body);
assert(body.query);
assert(body.result);
done();
}); });
}); });

Loading…
Cancel
Save