@@ -190,75 +190,25 @@ describe('vue-numeric', () => {
190190 } )
191191 } )
192192
193- it ( 'allow minus value when minus props is true ' , done => {
193+ it ( 'updates value with currency symbol ' , done => {
194194 const vm = new Vue ( {
195195 el,
196196 data ( ) {
197197 return {
198- total : - 100
199- }
200- } ,
201- template : '<div><vue-numeric v-model="total" :minus="true"></vue-numeric></div>' ,
202- components : { VueNumeric }
203- } ) . $mount ( )
204-
205- Vue . nextTick ( ( ) => {
206- expect ( vm . $el . firstChild . value . trim ( ) ) . toEqual ( '-100' )
207- done ( )
208- } )
209- } )
210-
211- it ( 'disallow minus value when minus props is false' , done => {
212- const vm = new Vue ( {
213- el,
214- data ( ) {
215- return {
216- total : - 100
198+ total : 0
217199 }
218200 } ,
219- template : '<div><vue-numeric v-model="total" :minus="false "></vue-numeric></div>' ,
201+ template : '<div><vue-numeric v-model="total" currency="CZK" currencySymbolPosition="sufix" precision=2 separator=". "></vue-numeric></div>' ,
220202 components : { VueNumeric }
221203 } ) . $mount ( )
222204
223- Vue . nextTick ( ( ) => {
224- expect ( vm . $el . firstChild . value . trim ( ) ) . toEqual ( '100' )
225- done ( )
226- } )
227- } )
228-
229- it ( 'value cannot exceed max props' , done => {
230- const vm = new Vue ( {
231- el,
232- data ( ) {
233- return {
234- total : 150
235- }
236- } ,
237- template : '<div><vue-numeric v-model="total" :max="100"></vue-numeric></div>' ,
238- components : { VueNumeric }
239- } ) . $mount ( )
205+ //vm.$el.firstChild.focus()
206+ vm . total = 3000
240207
241208 Vue . nextTick ( ( ) => {
242- expect ( vm . $el . firstChild . value . trim ( ) ) . toEqual ( '100 ' )
209+ expect ( vm . $el . firstChild . value . trim ( ) ) . toEqual ( '3.000,00 CZK ' )
243210 done ( )
244211 } )
245212 } )
246213
247- it ( 'value cannot below min props' , done => {
248- const vm = new Vue ( {
249- el,
250- data ( ) {
251- return {
252- total : 150
253- }
254- } ,
255- template : '<div><vue-numeric v-model="total" :min="200"></vue-numeric></div>' ,
256- components : { VueNumeric }
257- } ) . $mount ( )
258-
259- Vue . nextTick ( ( ) => {
260- expect ( vm . $el . firstChild . value . trim ( ) ) . toEqual ( '200' )
261- done ( )
262- } )
263- } )
264214} )
0 commit comments