Dev: Settings karma test

This commit is contained in:
surunzi
2017-10-01 14:49:02 +08:00
parent c09e0cceca
commit 394728f482
4 changed files with 20 additions and 6 deletions

View File

@@ -7,6 +7,11 @@ cfg.set({
testSelect: ['1']
});
beforeEach(function ()
{
tool.clear();
});
describe('switch', function ()
{
it('ui', function ()
@@ -14,7 +19,7 @@ describe('switch', function ()
var text = 'Test Switch';
tool.switch(cfg, 'testSwitch', text);
expect($tool.find('.eruda-switch').eq(3)).toContainText(text);
expect($tool.find('.eruda-switch')).toContainText(text);
});
});
@@ -23,7 +28,7 @@ describe('separator', function ()
it('ui', function ()
{
tool.separator();
expect($tool.find('.eruda-separator').length).toEqual(4);
expect($tool.find('.eruda-separator').length).toEqual(1);
});
});
@@ -34,7 +39,7 @@ describe('select', function ()
var text = 'Test Select';
tool.select(cfg, 'testSelect', text, ['1', '2', '3']);
var $el = $tool.find('.eruda-select').eq(2);
var $el = $tool.find('.eruda-select');
expect($el.find('ul li').length).toEqual(3);
expect($el.find('.eruda-val')).toContainText('1');
});