From 9f143a3b2e2c8d6158e7d8e0c1c9cef8f6055274 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Tue, 11 Jan 2022 17:42:54 -0600 Subject: [PATCH] refactor(react): update InlineCheckbox to FC (#10363) * refactor(react): update InlineCheckbox to FC * chore(react): formatting of InlineCheckbox * fix(react): update InlineCheckbox prop types and usage in data table Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../__tests__/TableSelectAll-test.js | 2 +- .../__tests__/TableSelectRow-test.js | 2 +- .../__snapshots__/DataTable-test.js.snap | 155 ++++------- .../__snapshots__/TableSelectAll-test.js.snap | 30 +- .../__snapshots__/TableSelectRow-test.js.snap | 30 +- .../InlineCheckbox/InlineCheckbox-test.js | 6 +- .../InlineCheckbox/InlineCheckbox.js | 260 ++++++++---------- 7 files changed, 190 insertions(+), 295 deletions(-) diff --git a/packages/react/src/components/DataTable/__tests__/TableSelectAll-test.js b/packages/react/src/components/DataTable/__tests__/TableSelectAll-test.js index 62bf43aa3408..05af3efc6950 100644 --- a/packages/react/src/components/DataTable/__tests__/TableSelectAll-test.js +++ b/packages/react/src/components/DataTable/__tests__/TableSelectAll-test.js @@ -60,7 +60,7 @@ describe('DataTable.TableSelectAll', () => { ); - wrapper.find('InlineCheckbox input').simulate('click'); + wrapper.find('input').simulate('click'); expect(mockProps.onSelect).toHaveBeenCalledTimes(1); }); }); diff --git a/packages/react/src/components/DataTable/__tests__/TableSelectRow-test.js b/packages/react/src/components/DataTable/__tests__/TableSelectRow-test.js index 6aae2480ba19..3013c9c95264 100644 --- a/packages/react/src/components/DataTable/__tests__/TableSelectRow-test.js +++ b/packages/react/src/components/DataTable/__tests__/TableSelectRow-test.js @@ -61,7 +61,7 @@ describe('DataTable.TableSelectRow', () => { ); - wrapper.find('InlineCheckbox input').simulate('click'); + wrapper.find('input').simulate('click'); expect(mockProps.onSelect).toHaveBeenCalledTimes(1); }); }); diff --git a/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap b/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap index 78e987867553..152b8efb8e7d 100644 --- a/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap +++ b/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap @@ -975,32 +975,21 @@ exports[`DataTable selection should have select-all default to un-checked if no name="select-all" onClick={[Function]} > - - - + type="checkbox" + /> +