File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -184,4 +184,26 @@ describe('vue-numeric.vue', () => {
184
184
const wrapper = mount ( VueNumeric , { propsData : { value : 2000 , placeholder : 'number here' } } )
185
185
expect ( wrapper . data ( ) . amount ) . to . equal ( '' )
186
186
} )
187
+
188
+ it ( 'apply min props value if user input negative value when minus props disabled' , ( ) => {
189
+ const component = Vue . extend ( {
190
+ data : ( ) => ( { total : - 200 } ) ,
191
+ template : '<div><vue-numeric v-model="total" :min="150" :minus="false"></vue-numeric></div>' ,
192
+ components : { VueNumeric }
193
+ } )
194
+
195
+ const wrapper = mount ( component )
196
+ expect ( wrapper . data ( ) . total ) . to . equal ( 150 )
197
+ } )
198
+
199
+ it ( 'apply 0 value if user input negative value when minus props disabled and min props is negative too' , ( ) => {
200
+ const component = Vue . extend ( {
201
+ data : ( ) => ( { total : - 200 } ) ,
202
+ template : '<div><vue-numeric v-model="total" :min="-150" :minus="false"></vue-numeric></div>' ,
203
+ components : { VueNumeric }
204
+ } )
205
+
206
+ const wrapper = mount ( component )
207
+ expect ( wrapper . data ( ) . total ) . to . equal ( 0 )
208
+ } )
187
209
} )
You can’t perform that action at this time.
0 commit comments