mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
Dev: Settings karma test
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user