Skip to content

Commit

Permalink
add checkbox selection test
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Jul 22, 2022
1 parent e6f10b4 commit 045d5c4
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -881,4 +881,31 @@ describe('<DataGridPro /> - Row pinning', () => {
fireEvent.click(getCell(0, 0));
expect(apiRef!.current.isRowSelected(0)).to.equal(false);
});

it('should not render selection checkbox for pinned rows', () => {
const TestCase = () => {
const data = getData(20, 5);
const [pinnedRow0, pinnedRow1, ...rows] = data.rows;

return (
<div style={{ width: 302, height: 300 }}>
<DataGridPro
{...data}
rows={rows}
pinnedRows={{
top: [pinnedRow0],
bottom: [pinnedRow1],
}}
experimentalFeatures={{ rowPinning: true }}
checkboxSelection
/>
</div>
);
};

render(<TestCase />);

expect(getRowById(0)!.querySelector('input[type="checkbox"]')).to.equal(null);
expect(getRowById(1)!.querySelector('input[type="checkbox"]')).to.equal(null);
});
});

0 comments on commit 045d5c4

Please sign in to comment.