From 92d423888635b212eda91364cf53f31b381e659a Mon Sep 17 00:00:00 2001 From: Christophe Date: Thu, 14 Sep 2023 03:14:42 +0200 Subject: [PATCH] test(Paginator): fix test broken by changes --- components/Paginator.test.tsx | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/components/Paginator.test.tsx b/components/Paginator.test.tsx index c6cf4cf..5441eba 100644 --- a/components/Paginator.test.tsx +++ b/components/Paginator.test.tsx @@ -14,11 +14,7 @@ describe('pagination', () => { test('first', () => { const onChange = jest.fn(); - render( - <> - {' '} - - ); + render(); act(() => { screen.getByTestId('paginator-first').click(); }); @@ -27,11 +23,7 @@ describe('pagination', () => { }); test('prev', () => { const onChange = jest.fn(); - render( - <> - {' '} - - ); + render(); act(() => { screen.getByTestId('paginator-prev').click(); }); @@ -40,11 +32,7 @@ describe('pagination', () => { }); test('next', () => { const onChange = jest.fn(); - render( - <> - {' '} - - ); + render(); act(() => { screen.getByTestId('paginator-next').click(); }); @@ -53,11 +41,7 @@ describe('pagination', () => { }); test('last', () => { const onChange = jest.fn(); - render( - <> - {' '} - - ); + render(); act(() => { screen.getByTestId('paginator-last').click(); }); @@ -67,15 +51,11 @@ describe('pagination', () => { test('specific', () => { const onChange = jest.fn(); - render( - <> - {' '} - - ); + render(); act(() => { - screen.getByText('6').click(); + screen.getByText('5').click(); }); - expect(onChange).toHaveBeenCalledWith(6); + expect(onChange).toHaveBeenCalledWith(5); }); });