Skip to content

Commit

Permalink
test internal pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
mbasso committed Jun 5, 2017
1 parent 1c054fa commit a9cac37
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion test/table.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,26 @@ describe('table', () => {
ReactTestUtils.Simulate.click(button);
});

// TODO : test internal pagination
it('should use internal pagination', () => {
const rendered = ReactTestUtils.renderIntoDocument(
<Table
pagination={props => (
<button onClick={() => props.onPageChange(42)} />
)}
/>,
);
const table = ReactTestUtils.findRenderedComponentWithType(
rendered,
Table,
);
expect(table.state.pageNumber).toEqual(undefined);
const button = ReactTestUtils.findRenderedDOMComponentWithTag(
rendered,
'button',
);
ReactTestUtils.Simulate.click(button);
expect(table.state.pageNumber).toEqual(42);
});
});

describe('search', () => {
Expand Down

0 comments on commit a9cac37

Please sign in to comment.