Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3ee61d

Browse files
author
Valentin Hervieu
committed
test: improve test about classes and attributes
1 parent 4747ab1 commit d3ee61d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/spec/rz-slider-service-test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ describe('rzslider - ', function() {
8181
expect(element.find('span')).to.have.length(11);
8282
expect(slider.range).to.be.false;
8383
expect(slider.valueRange).to.equal(100);
84+
expect(slider.maxH.css('display')).to.equal('none');
8485
});
8586

8687
it('should watch rzSliderModel and reflow the slider accordingly', function() {
@@ -169,6 +170,7 @@ describe('rzslider - ', function() {
169170
expect(element.find('span')).to.have.length(11);
170171
expect(slider.range).to.be.true;
171172
expect(slider.valueRange).to.equal(100);
173+
expect(slider.maxH.css('display')).to.equal('');
172174
});
173175

174176
it('should watch rzSliderHigh and reflow the slider accordingly', function() {
@@ -288,6 +290,7 @@ describe('rzslider - ', function() {
288290
expect(element[0].getBoundingClientRect().width).to.equal(1000);
289291
expect(slider.positionProperty).to.equal('left');
290292
expect(slider.dimensionProperty).to.equal('width');
293+
expect(slider.sliderElem.hasClass('vertical')).to.be.false;
291294
});
292295

293296
it('vertical slider should take the full height and get correct position/dimension properties', function() {
@@ -297,6 +300,7 @@ describe('rzslider - ', function() {
297300
expect(element[0].getBoundingClientRect().height).to.equal(1000);
298301
expect(slider.positionProperty).to.equal('bottom');
299302
expect(slider.dimensionProperty).to.equal('height');
303+
expect(slider.sliderElem.hasClass('vertical')).to.be.true;
300304
});
301305

302306
it('should prevent invalid step', function() {
@@ -409,10 +413,17 @@ describe('rzslider - ', function() {
409413
createRangeSlider(sliderConf);
410414
});
411415

416+
it('should set the correct class to true when draggableRange is true', function() {
417+
scope.slider.options.draggableRange = true;
418+
scope.$digest();
419+
expect(slider.selBar.hasClass('rz-draggable')).to.be.true;
420+
});
421+
412422
it('should set draggableRange to true when draggableRangeOnly is true', function() {
413423
scope.slider.options.draggableRangeOnly = true;
414424
scope.$digest();
415425
expect(slider.options.draggableRange).to.be.true;
426+
expect(slider.selBar.hasClass('rz-draggable')).to.be.true;
416427
});
417428

418429
it('should sanitize rzSliderModel and rzSliderHigh between floor and ceil', function() {

0 commit comments

Comments
 (0)