9
9
type SampleProps = Omit < PaginationWidgetBaseProps , "onPageChange" > ;
10
10
11
11
describe ( PaginationWidgetBase . name , ( ) => {
12
- it ( "Should have its previous button be aria- disabled while on page 1" , async ( ) => {
12
+ it ( "Should have its previous button be disabled while on page 1" , async ( ) => {
13
13
const sampleProps : SampleProps [ ] = [
14
14
{ currentPage : 1 , pageSize : 5 , totalRecords : 6 } ,
15
15
{ currentPage : 1 , pageSize : 50 , totalRecords : 200 } ,
@@ -23,16 +23,15 @@ describe(PaginationWidgetBase.name, () => {
23
23
) ;
24
24
25
25
const prevButton = await screen . findByLabelText ( "Previous page" ) ;
26
- expect ( prevButton ) . not . toBeDisabled ( ) ;
27
- expect ( prevButton ) . toHaveAttribute ( "aria-disabled" , "true" ) ;
26
+ expect ( prevButton ) . toBeDisabled ( ) ;
28
27
29
28
await userEvent . click ( prevButton ) ;
30
29
expect ( onPageChange ) . not . toHaveBeenCalled ( ) ;
31
30
unmount ( ) ;
32
31
}
33
32
} ) ;
34
33
35
- it ( "Should have its next button be aria- disabled while on last page" , async ( ) => {
34
+ it ( "Should have its next button be disabled while on last page" , async ( ) => {
36
35
const sampleProps : SampleProps [ ] = [
37
36
{ currentPage : 2 , pageSize : 5 , totalRecords : 6 } ,
38
37
{ currentPage : 4 , pageSize : 50 , totalRecords : 200 } ,
@@ -46,8 +45,7 @@ describe(PaginationWidgetBase.name, () => {
46
45
) ;
47
46
48
47
const button = await screen . findByLabelText ( "Next page" ) ;
49
- expect ( button ) . not . toBeDisabled ( ) ;
50
- expect ( button ) . toHaveAttribute ( "aria-disabled" , "true" ) ;
48
+ expect ( button ) . toBeDisabled ( ) ;
51
49
52
50
await userEvent . click ( button ) ;
53
51
expect ( onPageChange ) . not . toHaveBeenCalled ( ) ;
@@ -72,13 +70,11 @@ describe(PaginationWidgetBase.name, () => {
72
70
const nextButton = await screen . findByLabelText ( "Next page" ) ;
73
71
74
72
expect ( prevButton ) . not . toBeDisabled ( ) ;
75
- expect ( prevButton ) . toHaveAttribute ( "aria-disabled" , "false" ) ;
76
73
77
74
await userEvent . click ( prevButton ) ;
78
75
expect ( onPageChange ) . toHaveBeenCalledTimes ( 1 ) ;
79
76
80
77
expect ( nextButton ) . not . toBeDisabled ( ) ;
81
- expect ( nextButton ) . toHaveAttribute ( "aria-disabled" , "false" ) ;
82
78
83
79
await userEvent . click ( nextButton ) ;
84
80
expect ( onPageChange ) . toHaveBeenCalledTimes ( 2 ) ;
0 commit comments