Fix: Max log number

This commit is contained in:
surunzi
2016-08-27 19:00:42 +08:00
parent 92a379b4cc
commit 1f937f3941
2 changed files with 31 additions and 2 deletions

View File

@@ -195,4 +195,33 @@ describe('filter', function ()
tool.filter('all');
});
});
});
describe('config', function ()
{
var config = tool.config;
it('max number', function ()
{
config.set('maxLogNum', '10');
tool.clear();
for (var i = 0; i < 20; i++) tool.log(i);
expect($tool.find('.eruda-log-item')).toHaveLength(10);
});
it('override console', function ()
{
config.set('overrideConsole', true);
console.clear();
console.log('test');
expect($tool.find('.eruda-log-item')).toContainText('test');
});
it('display extra info', function ()
{
config.set('displayExtraInfo', true);
tool.clear().log('test');
expect($tool.find('.eruda-logs li')).toContainElement('.eruda-header');
});
});