File tree 2 files changed +44
-1
lines changed
2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,49 @@ describe('rangeSlider()', () => {
94
94
} ) ;
95
95
} ) ;
96
96
97
+ context ( 'when rangestats min === stats max' , ( ) => {
98
+ beforeEach ( ( ) => {
99
+ results = {
100
+ disjunctiveFacets : [ {
101
+ name : 'aNumAttr' ,
102
+ data : {
103
+ 65 : 1
104
+ } ,
105
+ exhaustive : true ,
106
+ stats : {
107
+ min : 65 ,
108
+ max : 65 ,
109
+ avg : 65 ,
110
+ sum : 65
111
+ }
112
+ } ]
113
+ } ;
114
+ } ) ;
115
+
116
+ it ( 'should shouldAutoHideContainer' , ( ) => {
117
+ widget . render ( { results, helper} ) ;
118
+
119
+ let props = {
120
+ cssClasses : { body : null , root : null } ,
121
+ onChange : ( ) => { } ,
122
+ pips : true ,
123
+ range : { max : 65 , min : 65 } ,
124
+ shouldAutoHideContainer : true ,
125
+ start : [ - Infinity , Infinity ] ,
126
+ step : 1 ,
127
+ templateProps : {
128
+ templates : { footer : '' , header : '' } ,
129
+ templatesConfig : undefined ,
130
+ transformData : undefined ,
131
+ useCustomCompileOptions : { footer : false , header : false }
132
+ } ,
133
+ tooltips : true
134
+ } ;
135
+
136
+ expect ( ReactDOM . render . firstCall . args [ 0 ] ) . toEqualJSX ( < Slider { ...props } /> ) ;
137
+ } ) ;
138
+ } ) ;
139
+
97
140
context ( 'with results' , ( ) => {
98
141
beforeEach ( ( ) => {
99
142
results = {
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ function rangeSlider({
112
112
} ;
113
113
}
114
114
115
- let hasNoRefinements = stats . min === null && stats . max === null ;
115
+ let hasNoRefinements = stats . min === stats . max ;
116
116
117
117
let templateProps = utils . prepareTemplateProps ( {
118
118
defaultTemplates,
You can’t perform that action at this time.
0 commit comments