added test for custom date range ACP, #5541

v1.18.x
Julian Lam 8 years ago
parent f7c31a6fa1
commit d3d58b77d9

@ -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) { it('should return error', function (done) {
socketAdmin.before({ uid: 10 }, 'someMethod', {}, function (err) { socketAdmin.before({ uid: 10 }, 'someMethod', {}, function (err) {
assert.equal(err.message, '[[error:no-privileges]]'); assert.equal(err.message, '[[error:no-privileges]]');

Loading…
Cancel
Save