Allow floats in the slider component and update docs

This commit is contained in:
Keegan
2016-03-11 01:07:17 +11:00
parent 1142d1adee
commit 878fea0340
11 changed files with 323 additions and 133 deletions
+11 -1
View File
@@ -3,7 +3,7 @@
var assert = require('chai').assert;
var fixture = require('../../fixture');
describe('component - select', function() {
describe('component - slider', function() {
it('sets the value display to the correct value on set', function() {
var clayConfig = fixture.clayConfig(['slider']);
var sliderItem = clayConfig.getItemsByType('slider')[0];
@@ -55,4 +55,14 @@ describe('component - select', function() {
$valueDisplay.set('value', 75).trigger('change');
assert.strictEqual($slider.get('value'), '75');
});
it('sets the precision correctly', function() {
var clayConfig = fixture.clayConfig([{
type: 'slider',
step: 0.25
}]);
var sliderItem = clayConfig.getItemsByType('slider')[0];
assert.strictEqual(sliderItem.precision, 2);
});
});