diff --git a/test/socket.io.js b/test/socket.io.js index 820a845c82..38e64fbd25 100644 --- a/test/socket.io.js +++ b/test/socket.io.js @@ -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]]');