@@ -258,8 +258,8 @@ describe('form-spinbutton', () => {
258
258
const $decrement = wrapper . find ( '[aria-label="Decrement"]' )
259
259
expect ( $decrement . exists ( ) ) . toBe ( true )
260
260
261
- $increment . trigger ( 'mousedown' )
262
- $increment . trigger ( 'mouseup' )
261
+ $decrement . trigger ( 'mousedown' )
262
+ $decrement . trigger ( 'mouseup' )
263
263
await waitNT ( wrapper . vm )
264
264
await waitRAF ( )
265
265
@@ -278,6 +278,26 @@ describe('form-spinbutton', () => {
278
278
expect ( $output . attributes ( 'aria-valuenow' ) ) . toEqual ( '2' )
279
279
expect ( $output . attributes ( 'aria-valuetext' ) ) . toEqual ( '2' )
280
280
281
+ $increment . trigger ( 'mousedown' )
282
+ $increment . trigger ( 'mouseup' )
283
+ await waitNT ( wrapper . vm )
284
+ await waitRAF ( )
285
+
286
+ expect ( $output . attributes ( 'aria-valuemin' ) ) . toEqual ( '1' )
287
+ expect ( $output . attributes ( 'aria-valuemax' ) ) . toEqual ( '100' )
288
+ expect ( $output . attributes ( 'aria-valuenow' ) ) . toEqual ( '3' )
289
+ expect ( $output . attributes ( 'aria-valuetext' ) ) . toEqual ( '3' )
290
+
291
+ $decrement . trigger ( 'mousedown' )
292
+ $decrement . trigger ( 'mouseup' )
293
+ await waitNT ( wrapper . vm )
294
+ await waitRAF ( )
295
+
296
+ expect ( $output . attributes ( 'aria-valuemin' ) ) . toEqual ( '1' )
297
+ expect ( $output . attributes ( 'aria-valuemax' ) ) . toEqual ( '100' )
298
+ expect ( $output . attributes ( 'aria-valuenow' ) ) . toEqual ( '2' )
299
+ expect ( $output . attributes ( 'aria-valuetext' ) ) . toEqual ( '2' )
300
+
281
301
$decrement . trigger ( 'mousedown' )
282
302
$decrement . trigger ( 'mouseup' )
283
303
await waitNT ( wrapper . vm )
@@ -299,6 +319,32 @@ describe('form-spinbutton', () => {
299
319
expect ( $output . attributes ( 'aria-valuenow' ) ) . toEqual ( '1' )
300
320
expect ( $output . attributes ( 'aria-valuetext' ) ) . toEqual ( '1' )
301
321
322
+ wrapper . setProps ( {
323
+ wrap : true
324
+ } )
325
+
326
+ $decrement . trigger ( 'mousedown' )
327
+ $decrement . trigger ( 'mouseup' )
328
+ await waitNT ( wrapper . vm )
329
+ await waitRAF ( )
330
+
331
+ expect ( $output . attributes ( 'aria-valuemin' ) ) . toEqual ( '1' )
332
+ expect ( $output . attributes ( 'aria-valuemax' ) ) . toEqual ( '100' )
333
+ // wrap is one so it should change to 100
334
+ expect ( $output . attributes ( 'aria-valuenow' ) ) . toEqual ( '100' )
335
+ expect ( $output . attributes ( 'aria-valuetext' ) ) . toEqual ( '100' )
336
+
337
+ $increment . trigger ( 'mousedown' )
338
+ $increment . trigger ( 'mouseup' )
339
+ await waitNT ( wrapper . vm )
340
+ await waitRAF ( )
341
+
342
+ expect ( $output . attributes ( 'aria-valuemin' ) ) . toEqual ( '1' )
343
+ expect ( $output . attributes ( 'aria-valuemax' ) ) . toEqual ( '100' )
344
+ // wrap is one so it should change to 1
345
+ expect ( $output . attributes ( 'aria-valuenow' ) ) . toEqual ( '1' )
346
+ expect ( $output . attributes ( 'aria-valuetext' ) ) . toEqual ( '1' )
347
+
302
348
wrapper . destroy ( )
303
349
} )
304
350
0 commit comments