@@ -56,7 +56,7 @@ describe('pagination', () => {
56
56
if ( index === 2 ) {
57
57
expect ( li . classes ( ) ) . toContain ( 'active' )
58
58
expect ( li . classes ( ) ) . not . toContain ( 'disabled' )
59
- expect ( pageLink . is ( 'a ' ) ) . toBe ( true )
59
+ expect ( pageLink . is ( 'button ' ) ) . toBe ( true )
60
60
} else {
61
61
expect ( li . classes ( ) ) . not . toContain ( 'active' )
62
62
expect ( li . classes ( ) ) . toContain ( 'disabled' )
@@ -78,14 +78,13 @@ describe('pagination', () => {
78
78
expect ( last . find ( '.page-link' ) . text ( ) ) . toEqual ( '»' )
79
79
80
80
// Page button attrs
81
- expect ( page . find ( '.page-link' ) . attributes ( 'href ' ) ) . toEqual ( '# ' )
81
+ expect ( page . find ( '.page-link' ) . attributes ( 'type ' ) ) . toEqual ( 'button ' )
82
82
expect ( page . find ( '.page-link' ) . attributes ( 'role' ) ) . toEqual ( 'menuitemradio' )
83
83
expect ( page . find ( '.page-link' ) . attributes ( 'aria-checked' ) ) . toEqual ( 'true' )
84
84
expect ( page . find ( '.page-link' ) . attributes ( 'aria-posinset' ) ) . toEqual ( '1' )
85
85
expect ( page . find ( '.page-link' ) . attributes ( 'aria-setsize' ) ) . toEqual ( '1' )
86
86
expect ( page . find ( '.page-link' ) . attributes ( 'tabindex' ) ) . toEqual ( '0' )
87
87
expect ( page . find ( '.page-link' ) . attributes ( 'aria-label' ) ) . toEqual ( 'Go to page 1' )
88
- expect ( page . find ( '.page-link' ) . attributes ( 'target' ) ) . toEqual ( '_self' )
89
88
90
89
wrapper . destroy ( )
91
90
} )
@@ -133,7 +132,7 @@ describe('pagination', () => {
133
132
disabled : false
134
133
} )
135
134
136
- const $links = wrapper . findAll ( 'a .page-link' )
135
+ const $links = wrapper . findAll ( 'button .page-link' )
137
136
expect ( $links . length ) . toBe ( 5 )
138
137
expect ( $links . at ( 0 ) . text ( ) ) . toBe ( 'Page 1' )
139
138
expect ( $links . at ( 1 ) . text ( ) ) . toBe ( 'Page 2' )
@@ -388,16 +387,16 @@ describe('pagination', () => {
388
387
} )
389
388
expect ( wrapper . is ( 'ul' ) ) . toBe ( true )
390
389
expect ( wrapper . findAll ( 'li' ) . length ) . toBe ( 5 )
391
- expect ( wrapper . findAll ( 'a .page-link' ) . length ) . toBe ( 4 )
392
- expect ( wrapper . findAll ( 'a .page-link' ) . is ( '[aria-controls="foo"]' ) ) . toBe ( true )
390
+ expect ( wrapper . findAll ( 'button .page-link' ) . length ) . toBe ( 4 )
391
+ expect ( wrapper . findAll ( 'button .page-link' ) . is ( '[aria-controls="foo"]' ) ) . toBe ( true )
393
392
394
393
wrapper . setProps ( {
395
394
ariaControls : null
396
395
} )
397
396
await waitNT ( wrapper . vm )
398
397
expect ( wrapper . findAll ( 'li' ) . length ) . toBe ( 5 )
399
- expect ( wrapper . findAll ( 'a .page-link' ) . length ) . toBe ( 4 )
400
- expect ( wrapper . findAll ( 'a .page-link' ) . is ( '[aria-controls]' ) ) . toBe ( false )
398
+ expect ( wrapper . findAll ( 'button .page-link' ) . length ) . toBe ( 4 )
399
+ expect ( wrapper . findAll ( 'button .page-link' ) . is ( '[aria-controls]' ) ) . toBe ( false )
401
400
402
401
wrapper . destroy ( )
403
402
} )
@@ -414,28 +413,28 @@ describe('pagination', () => {
414
413
} )
415
414
expect ( wrapper . is ( 'ul' ) ) . toBe ( true )
416
415
expect ( wrapper . findAll ( 'li' ) . length ) . toBe ( 5 )
417
- expect ( wrapper . findAll ( 'a ' ) . length ) . toBe ( 4 )
416
+ expect ( wrapper . findAll ( 'button ' ) . length ) . toBe ( 4 )
418
417
expect (
419
418
wrapper
420
- . findAll ( 'a ' )
419
+ . findAll ( 'button ' )
421
420
. at ( 0 )
422
421
. attributes ( 'aria-label' )
423
422
) . toBe ( 'Go to page 1' )
424
423
expect (
425
424
wrapper
426
- . findAll ( 'a ' )
425
+ . findAll ( 'button ' )
427
426
. at ( 1 )
428
427
. attributes ( 'aria-label' )
429
428
) . toBe ( 'Go to page 2' )
430
429
expect (
431
430
wrapper
432
- . findAll ( 'a ' )
431
+ . findAll ( 'button ' )
433
432
. at ( 2 )
434
433
. attributes ( 'aria-label' )
435
434
) . toBe ( 'Go to page 3' )
436
435
expect (
437
436
wrapper
438
- . findAll ( 'a ' )
437
+ . findAll ( 'button ' )
439
438
. at ( 3 )
440
439
. attributes ( 'aria-label' )
441
440
) . toBe ( 'Go to next page' )
@@ -654,7 +653,7 @@ describe('pagination', () => {
654
653
wrapper
655
654
. findAll ( 'li' )
656
655
. at ( 3 )
657
- . find ( 'a ' )
656
+ . find ( 'button ' )
658
657
. trigger ( 'click' )
659
658
await waitNT ( wrapper . vm )
660
659
expect ( wrapper . vm . computedCurrentPage ) . toBe ( 2 )
@@ -667,7 +666,7 @@ describe('pagination', () => {
667
666
wrapper
668
667
. findAll ( 'li' )
669
668
. at ( 6 )
670
- . find ( 'a ' )
669
+ . find ( 'button ' )
671
670
. trigger ( 'keydown.space' ) // Generates a click event
672
671
await waitNT ( wrapper . vm )
673
672
expect ( wrapper . vm . computedCurrentPage ) . toBe ( 3 )
@@ -678,7 +677,7 @@ describe('pagination', () => {
678
677
wrapper
679
678
. findAll ( 'li' )
680
679
. at ( 1 )
681
- . find ( 'a ' )
680
+ . find ( 'button ' )
682
681
. trigger ( 'click' )
683
682
await waitNT ( wrapper . vm )
684
683
expect ( wrapper . vm . computedCurrentPage ) . toBe ( 2 )
@@ -1031,7 +1030,7 @@ describe('pagination', () => {
1031
1030
expect ( wrapper . is ( 'ul' ) ) . toBe ( true )
1032
1031
await waitNT ( wrapper . vm )
1033
1032
// Grab the button links (2 bookends + 3 pages + 2 bookends)
1034
- const links = wrapper . findAll ( 'a .page-link' )
1033
+ const links = wrapper . findAll ( 'button .page-link' )
1035
1034
expect ( links . length ) . toBe ( 7 )
1036
1035
1037
1036
// Sanity check for getBCR override
@@ -1091,7 +1090,7 @@ describe('pagination', () => {
1091
1090
await waitNT ( wrapper . vm )
1092
1091
expect ( wrapper . is ( 'ul' ) ) . toBe ( true )
1093
1092
// Grab the button links (2 bookends + 3 pages + 2 bookends)
1094
- const links = wrapper . findAll ( 'a .page-link' )
1093
+ const links = wrapper . findAll ( 'button .page-link' )
1095
1094
expect ( links . length ) . toBe ( 7 )
1096
1095
1097
1096
// Focus the last button
@@ -1121,14 +1120,14 @@ describe('pagination', () => {
1121
1120
await waitNT ( wrapper . vm )
1122
1121
expect ( wrapper . is ( 'ul' ) ) . toBe ( true )
1123
1122
// Grab the button links (2 disabled bookends + 4 pages + (-ellipsis) + 2 bookends)
1124
- links = wrapper . findAll ( 'a .page-link' )
1123
+ links = wrapper . findAll ( 'button .page-link' )
1125
1124
expect ( links . length ) . toBe ( 6 )
1126
1125
1127
1126
// Click on the 4th button (page 4, index 3)
1128
1127
links . at ( 3 ) . element . click ( )
1129
1128
await waitNT ( wrapper . vm )
1130
1129
// Links re-rendered with first bookends enabled and an ellipsis
1131
- links = wrapper . findAll ( 'a .page-link' )
1130
+ links = wrapper . findAll ( 'button .page-link' )
1132
1131
// The 4th link should be page 4, and retain focus
1133
1132
expect ( document . activeElement ) . toEqual ( links . at ( 3 ) . element )
1134
1133
0 commit comments