Skip to content

Commit 73308a1

Browse files
committed
Starts fixing some unit tests
1 parent b7e3756 commit 73308a1

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

karma.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = function (config) {
88
// testing framework to use (jasmine/mocha/qunit/...)
99
frameworks: ['mocha', 'sinon', 'chai'],
1010

11-
reporters: ['dots', 'coverage'],
11+
reporters: ['dots', /*'coverage'*/],
1212

1313
// list of files / patterns to load in the browser
1414
files: [
@@ -26,7 +26,7 @@ module.exports = function (config) {
2626

2727
// preprocess matching files before serving them to the browser
2828
preprocessors: {
29-
"src/*.js": ['coverage'],
29+
//"src/*.js": ['coverage'],
3030
"src/*Tpl.html": 'ng-html2js'
3131
},
3232

src/rzslider.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,9 @@
374374
this.scope.$watch('rzSliderOptions()', function(newValue, oldValue) {
375375
if (newValue === oldValue)
376376
return;
377+
self.syncLowValue();
378+
if (self.range)
379+
self.syncHighValue();
377380
self.applyOptions();
378381
self.resetSlider();
379382
}, true);
@@ -461,6 +464,8 @@
461464
*/
462465
onLowHandleChange: function() {
463466
this.syncLowValue();
467+
if (this.range)
468+
this.syncHighValue();
464469
this.setMinAndMax();
465470
this.updateLowHandle(this.valueToOffset(this.lowValue));
466471
this.updateSelectionBar();
@@ -475,6 +480,7 @@
475480
* Reflow the slider when the high handle changes (called with throttle)
476481
*/
477482
onHighHandleChange: function() {
483+
this.syncLowValue();
478484
this.syncHighValue();
479485
this.setMinAndMax();
480486
this.updateHighHandle(this.valueToOffset(this.highValue));

tests/specs/options-handling-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@
11171117
});
11181118
});
11191119

1120-
describe('range slider spcific - ', function() {
1120+
describe('range slider specific - ', function() {
11211121
beforeEach(function() {
11221122
var sliderConf = {
11231123
min: 10,

tests/specs/range-slider-init-test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@
7272
});
7373

7474
it('should round the model value to the step', function() {
75-
helper.scope.slider.min = 13;
76-
helper.scope.slider.max = 94;
75+
helper.scope.slider.min = 23;
76+
helper.scope.slider.max = 84;
7777
helper.scope.$digest();
78-
expect(helper.scope.slider.min).to.equal(10);
79-
expect(helper.scope.slider.max).to.equal(90);
78+
expect(helper.scope.slider.min).to.equal(20);
79+
expect(helper.scope.slider.max).to.equal(80);
8080

81-
helper.scope.slider.min = 15;
81+
helper.scope.slider.min = 25;
8282
helper.scope.slider.max = 95;
8383
helper.scope.$digest();
8484
$timeout.flush(); //to flush the throttle function
85-
expect(helper.scope.slider.min).to.equal(20);
85+
expect(helper.scope.slider.min).to.equal(30);
8686
expect(helper.scope.slider.max).to.equal(100);
8787
});
8888

0 commit comments

Comments
 (0)