mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 01:26:16 +01:00
added test for custom date range ACP, #5541
This commit is contained in:
@@ -346,6 +346,18 @@ describe('socket.io', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should allow a custom date range for traffic graph analytics', function (done) {
|
||||
io.emit('admin.analytics.get', { graph: 'traffic', units: 'days', amount: '7' }, function (err, data) {
|
||||
assert.ifError(err);
|
||||
assert(data);
|
||||
assert(data.pageviews);
|
||||
assert(data.uniqueVisitors);
|
||||
assert.strictEqual(7, data.pageviews.length);
|
||||
assert.strictEqual(7, data.uniqueVisitors.length);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should return error', function (done) {
|
||||
socketAdmin.before({ uid: 10 }, 'someMethod', {}, function (err) {
|
||||
assert.equal(err.message, '[[error:no-privileges]]');
|
||||
|
||||
Reference in New Issue
Block a user