mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
fix #932
This commit is contained in:
parent
a1457dfe59
commit
2c6cc915f0
@ -43,12 +43,10 @@ export default class SelectionCell extends Component {
|
||||
selected,
|
||||
onRowSelect,
|
||||
disabled,
|
||||
rowIndex,
|
||||
clickToSelect
|
||||
rowIndex
|
||||
} = this.props;
|
||||
|
||||
e.stopPropagation();
|
||||
if (disabled) return;
|
||||
if (clickToSelect) return;
|
||||
|
||||
const checked = inputType === Const.ROW_SELECT_SINGLE
|
||||
? true
|
||||
|
||||
@ -147,7 +147,7 @@ describe('<SelectionCell />', () => {
|
||||
/>,
|
||||
{ bootstrap4: false }
|
||||
);
|
||||
wrapper.find('td').simulate('click');
|
||||
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
|
||||
});
|
||||
|
||||
it('should calling handleRowClicked', () => {
|
||||
@ -173,7 +173,7 @@ describe('<SelectionCell />', () => {
|
||||
/>,
|
||||
{ bootstrap4: false }
|
||||
);
|
||||
wrapper.find('td').simulate('click');
|
||||
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
|
||||
});
|
||||
|
||||
it('should calling handleRowClicked', () => {
|
||||
@ -201,7 +201,7 @@ describe('<SelectionCell />', () => {
|
||||
|
||||
it('should be called with correct paramters', () => {
|
||||
// first click
|
||||
wrapper.find('td').simulate('click');
|
||||
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
|
||||
expect(mockOnRowSelect.callCount).toBe(1);
|
||||
expect(mockOnRowSelect.calledWith(rowKey, true, rowIndex)).toBe(true);
|
||||
});
|
||||
@ -223,9 +223,9 @@ describe('<SelectionCell />', () => {
|
||||
|
||||
it('should be called with correct parameters', () => {
|
||||
// first click
|
||||
wrapper.find('td').simulate('click');
|
||||
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
|
||||
expect(mockOnRowSelect.callCount).toBe(1);
|
||||
expect(mockOnRowSelect.calledWith(rowKey, false, rowIndex, undefined)).toBe(true);
|
||||
expect(mockOnRowSelect.calledWith(rowKey, false, rowIndex)).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user