Skip to content

Commit

Permalink
search by label test
Browse files Browse the repository at this point in the history
  • Loading branch information
jcger committed Nov 29, 2023
1 parent 11a8ee2 commit 4d439b6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ export const MultiSelectFilter = <T extends string, K extends string = string>({
<EuiSelectable<FilterOption<T, K>>
options={options}
searchable
searchProps={{ placeholder: buttonLabel, compressed: false }}
searchProps={{
placeholder: buttonLabel,
compressed: false,
'data-test-subj': `${id}-search-input`,
}}
emptyMessage={i18n.EMPTY_FILTER_MESSAGE}
onChange={_onChange}
singleSelection={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ describe('CasesTableFilters ', () => {
});
});

it('should show in progress status only when "in p" is searched in the filter', async () => {
appMockRender.render(<CasesTableFilters {...props} />);

userEvent.click(screen.getByTestId('options-filter-popover-button-status'));
await waitForEuiPopoverOpen();

userEvent.type(screen.getByTestId('status-search-input'), 'in p');

const allOptions = screen.getAllByRole('option');
expect(allOptions).toHaveLength(1);
expect(allOptions[0]).toHaveTextContent('In progress');
});

it('should remove assignee from selected assignees when assignee no longer exists', async () => {
const overrideProps = {
...props,
Expand Down

0 comments on commit 4d439b6

Please sign in to comment.