@@ -13,16 +13,12 @@ describe("PageView Component", () => {
1313 mockOnPage . mockClear ( ) ;
1414 } ) ;
1515
16- it ( "No data: should disable both buttons and display '-' " , ( ) => {
16+ it ( "No data: pager should not be rendered " , ( ) => {
1717 renderComponent ( undefined ) ;
1818
19- expect ( screen . getByText ( "-" ) ) . toBeInTheDocument ( ) ;
20- expect ( screen . getByTestId ( "next" ) . closest ( "li" ) ) . toHaveClass (
21- "disabled"
22- ) ;
23- expect ( screen . getByTestId ( "prev" ) . closest ( "li" ) ) . toHaveClass (
24- "disabled"
25- ) ;
19+ expect ( screen . queryByText ( "-" ) ) . not . toBeInTheDocument ( ) ;
20+ expect ( screen . queryByTestId ( "next" ) ) . not . toBeInTheDocument ( ) ;
21+ expect ( screen . queryByTestId ( "prev" ) ) . not . toBeInTheDocument ( ) ;
2622 } ) ;
2723
2824 it ( "Middle page: should enable both Prev and Next" , ( ) => {
@@ -31,7 +27,7 @@ describe("PageView Component", () => {
3127 content : new Array ( 10 ) ,
3228 } ) ;
3329
34- expect ( screen . getByText ( "20 / 30" ) ) . toBeInTheDocument ( ) ;
30+ expect ( screen . queryByText ( "20 / 30" ) ) . toBeInTheDocument ( ) ;
3531 expect (
3632 screen . getByRole ( "button" , { name : "Previous" } )
3733 ) . not . toBeDisabled ( ) ;
@@ -50,7 +46,7 @@ describe("PageView Component", () => {
5046 content : [ ] ,
5147 } ) ;
5248
53- expect ( screen . getByText ( "0 / 10" ) ) . toBeInTheDocument ( ) ;
49+ expect ( screen . queryByText ( "0 / 10" ) ) . toBeInTheDocument ( ) ;
5450 expect ( screen . getByTestId ( "next" ) . closest ( "li" ) ) . toHaveClass (
5551 "disabled"
5652 ) ;
0 commit comments