1
0
mirror of synced 2025-12-10 08:28:08 +08:00

Add: Settings range

This commit is contained in:
surunzi
2017-10-01 18:48:25 +08:00
parent 394728f482
commit 59fd98d8a6
8 changed files with 109 additions and 14 deletions

View File

@@ -6,7 +6,7 @@ function boot(name, cb)
eruda.init({
tool: name === 'settings' ? [] : name
});
eruda.show().get().config.set('displaySize', '50%');
eruda.show().get().config.set('displaySize', '50');
cb && cb();

View File

@@ -4,7 +4,8 @@ var tool = eruda.get('settings'),
var cfg = eruda.config.create('eruda-test');
cfg.set({
testSwitch: false,
testSelect: ['1']
testSelect: '1',
testRange: 1
});
beforeEach(function ()
@@ -41,6 +42,20 @@ describe('select', function ()
tool.select(cfg, 'testSelect', text, ['1', '2', '3']);
var $el = $tool.find('.eruda-select');
expect($el.find('ul li').length).toEqual(3);
expect($el.find('.eruda-head')).toContainText(text);
expect($el.find('.eruda-val')).toContainText('1');
});
});
describe('range', function ()
{
it('ui', function ()
{
var text = 'Test Range';
tool.range(cfg, 'testRange', text, {min: 0, max: 1, step: 0.1});
var $el = $tool.find('.eruda-range');
expect($el.find('.eruda-head')).toContainText(text);
expect($el.find('input').length).toEqual(1);
});
});