Skip to content

Commit

Permalink
test(Paginator): fix test broken by changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChristophe committed Sep 14, 2023
1 parent 64c1ba3 commit 92d4238
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions components/Paginator.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ describe('pagination', () => {

test('first', () => {
const onChange = jest.fn();
render(
<>
<Paginator navigateTo={onChange} pagination={pagination} />{' '}
</>
);
render(<Paginator navigateTo={onChange} pagination={pagination} />);
act(() => {
screen.getByTestId('paginator-first').click();
});
Expand All @@ -27,11 +23,7 @@ describe('pagination', () => {
});
test('prev', () => {
const onChange = jest.fn();
render(
<>
<Paginator navigateTo={onChange} pagination={pagination} />{' '}
</>
);
render(<Paginator navigateTo={onChange} pagination={pagination} />);
act(() => {
screen.getByTestId('paginator-prev').click();
});
Expand All @@ -40,11 +32,7 @@ describe('pagination', () => {
});
test('next', () => {
const onChange = jest.fn();
render(
<>
<Paginator navigateTo={onChange} pagination={pagination} />{' '}
</>
);
render(<Paginator navigateTo={onChange} pagination={pagination} />);
act(() => {
screen.getByTestId('paginator-next').click();
});
Expand All @@ -53,11 +41,7 @@ describe('pagination', () => {
});
test('last', () => {
const onChange = jest.fn();
render(
<>
<Paginator navigateTo={onChange} pagination={pagination} />{' '}
</>
);
render(<Paginator navigateTo={onChange} pagination={pagination} />);
act(() => {
screen.getByTestId('paginator-last').click();
});
Expand All @@ -67,15 +51,11 @@ describe('pagination', () => {

test('specific', () => {
const onChange = jest.fn();
render(
<>
<Paginator navigateTo={onChange} pagination={pagination} />{' '}
</>
);
render(<Paginator navigateTo={onChange} pagination={pagination} />);
act(() => {
screen.getByText('6').click();
screen.getByText('5').click();
});

expect(onChange).toHaveBeenCalledWith(6);
expect(onChange).toHaveBeenCalledWith(5);
});
});

0 comments on commit 92d4238

Please sign in to comment.