From f35d644608b0e8eb1642984b467e5be6c69d5cf3 Mon Sep 17 00:00:00 2001 From: Jeremy Nagel Date: Mon, 16 Jul 2018 11:18:02 +1000 Subject: [PATCH 1/2] [BUGFIX] Fix issue with missing onChange prop for selection checkbox --- .../src/row-selection/selection-header-cell.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-bootstrap-table2/src/row-selection/selection-header-cell.js b/packages/react-bootstrap-table2/src/row-selection/selection-header-cell.js index 9879026..c92e7c3 100644 --- a/packages/react-bootstrap-table2/src/row-selection/selection-header-cell.js +++ b/packages/react-bootstrap-table2/src/row-selection/selection-header-cell.js @@ -77,6 +77,7 @@ export default class SelectionHeaderCell extends Component { { ...this.props } checked={ checked } indeterminate={ indeterminate } + onChange={ this.handleCheckBoxClick } /> ); attrs.onClick = this.handleCheckBoxClick; From 96d33a60ba14874ae6fb5592be50962a15bd2d5c Mon Sep 17 00:00:00 2001 From: Jeremy Nagel Date: Mon, 13 Aug 2018 16:50:43 +1000 Subject: [PATCH 2/2] Add snapshot tests --- .../__snapshots__/selection-cell.test.js.snap | 14 ++++++++++++++ .../selection-header-cell.test.js.snap | 9 +++++++++ .../test/row-selection/selection-cell.test.js | 8 +++++++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 packages/react-bootstrap-table2/test/row-selection/__snapshots__/selection-cell.test.js.snap create mode 100644 packages/react-bootstrap-table2/test/row-selection/__snapshots__/selection-header-cell.test.js.snap diff --git a/packages/react-bootstrap-table2/test/row-selection/__snapshots__/selection-cell.test.js.snap b/packages/react-bootstrap-table2/test/row-selection/__snapshots__/selection-cell.test.js.snap new file mode 100644 index 0000000..2f5e4dc --- /dev/null +++ b/packages/react-bootstrap-table2/test/row-selection/__snapshots__/selection-cell.test.js.snap @@ -0,0 +1,14 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` render should render component correctly 1`] = ` + + + +`; diff --git a/packages/react-bootstrap-table2/test/row-selection/__snapshots__/selection-header-cell.test.js.snap b/packages/react-bootstrap-table2/test/row-selection/__snapshots__/selection-header-cell.test.js.snap new file mode 100644 index 0000000..522b3e5 --- /dev/null +++ b/packages/react-bootstrap-table2/test/row-selection/__snapshots__/selection-header-cell.test.js.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` render should render component correctly 1`] = ` + +`; diff --git a/packages/react-bootstrap-table2/test/row-selection/selection-cell.test.js b/packages/react-bootstrap-table2/test/row-selection/selection-cell.test.js index 967c626..311c361 100644 --- a/packages/react-bootstrap-table2/test/row-selection/selection-cell.test.js +++ b/packages/react-bootstrap-table2/test/row-selection/selection-cell.test.js @@ -170,7 +170,13 @@ describe('', () => { describe('when disabled prop give as true', () => { beforeEach(() => { wrapper = shallowWithContext( - , + , { bootstrap4: false } ); });