From aa2676dcbe3aed39bdb6db13144a8343d936dbe8 Mon Sep 17 00:00:00 2001 From: Mathias Bronner Date: Thu, 6 Oct 2022 14:23:16 +0200 Subject: [PATCH] rename label prop to placeholder and remove obsolete test case Signed-off-by: Mathias Bronner --- .../GroupListPicker/GroupListPicker.test.tsx | 18 ++---------------- .../GroupListPicker/GroupListPicker.tsx | 10 +++++++--- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/plugins/catalog-react/src/components/GroupListPicker/GroupListPicker.test.tsx b/plugins/catalog-react/src/components/GroupListPicker/GroupListPicker.test.tsx index 77d1eead6d..6b89612354 100644 --- a/plugins/catalog-react/src/components/GroupListPicker/GroupListPicker.test.tsx +++ b/plugins/catalog-react/src/components/GroupListPicker/GroupListPicker.test.tsx @@ -67,7 +67,7 @@ describe('', () => { const { queryByText } = render( @@ -77,25 +77,11 @@ describe('', () => { expect(queryByText('test')).toBeInTheDocument(); }); - it('open group list picker', () => { - const { getByTestId, getAllByText } = render( - - - , - ); - - fireEvent.click(getByTestId('group-list-picker-button')); - expect(getAllByText('Search unique').length).toBeGreaterThan(0); - }); - it('can choose a group', async () => { const { getByText, queryByText, getByTestId } = render( , diff --git a/plugins/catalog-react/src/components/GroupListPicker/GroupListPicker.tsx b/plugins/catalog-react/src/components/GroupListPicker/GroupListPicker.tsx index eb504880f3..d810d44d57 100644 --- a/plugins/catalog-react/src/components/GroupListPicker/GroupListPicker.tsx +++ b/plugins/catalog-react/src/components/GroupListPicker/GroupListPicker.tsx @@ -51,7 +51,7 @@ const useStyles = makeStyles({ * @public */ export type GroupListPickerProps = { - label: string; + placeholder: string; groupTypes: Array; defaultGroup?: string; }; @@ -61,7 +61,7 @@ export const GroupListPicker = (props: GroupListPickerProps) => { const classes = useStyles(); const catalogApi = useApi(catalogApiRef); - const { label, groupTypes, defaultGroup = '' } = props; + const { placeholder, groupTypes, defaultGroup = '' } = props; const [anchorEl, setAnchorEl] = React.useState(null); const [inputValue, setInputValue] = React.useState(''); const [group, setGroup] = React.useState(defaultGroup); @@ -121,7 +121,11 @@ export const GroupListPicker = (props: GroupListPickerProps) => { }} style={{ width: '200px' }} renderInput={params => ( - + )} />