forked from liriliri/eruda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.js
41 lines (35 loc) · 914 Bytes
/
settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var tool = eruda.get('settings'),
$tool = $('.eruda-settings');
var cfg = eruda.config.create('eruda-test');
cfg.set({
testSwitch: false,
testSelect: ['1']
});
describe('switch', function ()
{
it('ui', function ()
{
var text = 'Test Switch';
tool.switch(cfg, 'testSwitch', text);
expect($tool.find('.eruda-switch').eq(3)).toContainText(text);
});
});
describe('separator', function ()
{
it('ui', function ()
{
tool.separator();
expect($tool.find('.eruda-separator').length).toEqual(4);
});
});
describe('select', function ()
{
it('ui', function ()
{
var text = 'Test Select';
tool.select(cfg, 'testSelect', text, ['1', '2', '3']);
var $el = $tool.find('.eruda-select').eq(2);
expect($el.find('ul li').length).toEqual(3);
expect($el.find('.eruda-val')).toContainText('1');
});
});