Skip to content

Commit 0b04c26

Browse files
author
Kubit
committed
Add regex to PopoverSearchList component
1 parent 19cc291 commit 0b04c26

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/components/functionalitiesModule/__tests__/functionalitiesModule.test.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ describe('FunctionalitiesModule component', () => {
101101
/>
102102
);
103103

104-
const buttonOption1 = screen.getAllByRole(ROLES.MENUITEM, {
105-
name: 'option 1',
106-
hidden: true,
107-
})?.[0];
104+
const buttonOption1 = screen.getByText('option 1');
108105
expect(buttonOption1.textContent).toBe(optionSelected);
109106

110107
const results = await axe(container);
@@ -181,7 +178,7 @@ describe('FunctionalitiesModule component', () => {
181178
{...mockProps}
182179
/>
183180
);
184-
const buttonOption1 = screen.getByRole(ROLES.MENUITEM, { name: 'option 1' });
181+
const buttonOption1 = screen.getByText('option 1');
185182
fireEvent.click(buttonOption1);
186183
expect(mockProps.onOptionClick).toHaveBeenCalled();
187184

src/components/inputSearch/components/popoverSearchList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { LoadingIcon } from './loadingIcon';
2424
import { OptionsList } from './optionsList';
2525

2626
export const PopoverSearchListComponent = (
27-
{ sublabel = 'Use this', ...props }: IPopoverSearchList,
27+
{ sublabel = { content: 'Use this' }, ...props }: IPopoverSearchList,
2828
ref: ForwardedRef<unknown>
2929
): JSX.Element => {
3030
const { refInput, refActionBottomSheet } = ref as unknown as MultipleRef;
@@ -192,6 +192,7 @@ export const PopoverSearchListComponent = (
192192
props.inputConfiguration?.icon?.onClick?.(event);
193193
},
194194
}}
195+
regex={props.regex}
195196
rightIcon={{
196197
...props.inputConfiguration?.rightIcon,
197198
onClick: event => {

0 commit comments

Comments
 (0)