Skip to content

Commit

Permalink
[TablePagination] Test forward ref
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Mar 31, 2019
1 parent 2a89708 commit dff9de7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/material-ui/src/TablePagination/TablePagination.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
import {
createShallow,
createMount,
describeConformance,
findOutermostIntrinsic,
getClasses,
} from '@material-ui/core/test-utils';
Expand All @@ -22,6 +23,17 @@ describe('<TablePagination />', () => {
let shallow;
let mount;

function mountInTable(node) {
const wrapper = mount(
<table>
<tbody>
<tr>{node}</tr>
</tbody>
</table>,
);
return wrapper.find('tr').childAt(0);
}

before(() => {
classes = getClasses(
<TablePagination count={1} onChangePage={() => {}} page={0} rowsPerPage={1} />,
Expand All @@ -34,6 +46,15 @@ describe('<TablePagination />', () => {
mount.cleanUp();
});

describeConformance(
<TablePagination count={1} onChangePage={() => {}} page={0} rowsPerPage={1} />,
() => ({
mount: mountInTable,
only: ['refForwarding'],
refInstanceof: window.HTMLTableCellElement,
}),
);

it('should render a TableCell', () => {
const wrapper = mount(
<table>
Expand Down

0 comments on commit dff9de7

Please sign in to comment.