|
667 | 667 | expect(helper.slider.lowValue).to.equal(1); |
668 | 668 | expect(helper.slider.highValue).to.equal(3); |
669 | 669 | }); |
| 670 | + |
| 671 | + it('should set the correct combined label when range values are the same and mergeRangeLabelsIfSame option is false', function() { |
| 672 | + helper.scope.slider.options.mergeRangeLabelsIfSame = false; |
| 673 | + helper.scope.slider.min = 50; |
| 674 | + helper.scope.slider.max = 50; |
| 675 | + helper.scope.$digest(); |
| 676 | + expect(helper.slider.cmbLab.text()).to.equal('50 - 50'); |
| 677 | + }); |
| 678 | + |
| 679 | + it('should set the correct combined label when range values are the same and mergeRangeLabelsIfSame option is true', function() { |
| 680 | + helper.scope.slider.options.mergeRangeLabelsIfSame = true; |
| 681 | + helper.scope.slider.min = 50; |
| 682 | + helper.scope.slider.max = 50; |
| 683 | + helper.scope.$digest(); |
| 684 | + expect(helper.slider.cmbLab.text()).to.equal('50'); |
| 685 | + }); |
670 | 686 | }); |
671 | 687 |
|
672 | 688 | describe('options expression specific - ', function() { |
|
889 | 905 | } |
890 | 906 | }; |
891 | 907 | helper.createSlider(sliderConf); |
892 | | - var expectedDimension = Math.floor(helper.slider.valueToOffset(8) + helper.slider.handleHalfDim); |
893 | | - expect(helper.slider.selBar[0].getBoundingClientRect().width).to.equal(expectedDimension); |
| 908 | + var expectedDimension = Math.floor(helper.slider.valueToOffset(8) + helper.slider.handleHalfDim), |
| 909 | + actualDimension = Math.floor(helper.slider.selBar[0].getBoundingClientRect().width); |
| 910 | + expect(actualDimension).to.equal(expectedDimension); |
894 | 911 | expect(helper.slider.selBar.css('left')).to.equal(helper.slider.valueToOffset(2) + helper.slider.handleHalfDim + 'px'); |
895 | 912 | }); |
896 | 913 |
|
|
939 | 956 | }; |
940 | 957 | helper.createSlider(sliderConf); |
941 | 958 | var expectedDimension = Math.floor(helper.slider.valueToOffset(13)), |
| 959 | + actualDimension = Math.floor(helper.slider.selBar[0].getBoundingClientRect().width), |
942 | 960 | expectedPosition = helper.slider.valueToOffset(10) + helper.slider.handleHalfDim; |
943 | | - expect(helper.slider.selBar[0].getBoundingClientRect().width).to.equal(expectedDimension); |
| 961 | + expect(actualDimension).to.equal(expectedDimension); |
944 | 962 | expect(helper.slider.selBar.css('left')).to.equal(expectedPosition + 'px'); |
945 | 963 | }); |
946 | 964 |
|
|
0 commit comments