diff --git a/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.test.tsx b/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.test.tsx index d2476c8dcc3..e81d0208cad 100644 --- a/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.test.tsx +++ b/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.test.tsx @@ -125,19 +125,19 @@ describe('SearchField', () => { jest.advanceTimersByTime(1000); const tag22 = await screen.findByText('tag22'); await user.click(tag22); - expect(updateFilter).toHaveBeenCalledWith({ ...filter, tag: 'tag22' }); + expect(updateFilter).toHaveBeenCalledWith({ ...filter, tag: 'tag22', value: [] }); // Select tag1 as the tag await user.click(select); jest.advanceTimersByTime(1000); const tag1 = await screen.findByText('tag1'); await user.click(tag1); - expect(updateFilter).toHaveBeenCalledWith({ ...filter, tag: 'tag1' }); + expect(updateFilter).toHaveBeenCalledWith({ ...filter, tag: 'tag1', value: [] }); // Remove the tag const tagRemove = await screen.findByLabelText('select-clear-value'); await user.click(tagRemove); - expect(updateFilter).toHaveBeenCalledWith({ ...filter, value: undefined }); + expect(updateFilter).toHaveBeenCalledWith({ ...filter, value: [] }); } }); diff --git a/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.tsx b/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.tsx index e0a8519dd5a..b2737726ad8 100644 --- a/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.tsx +++ b/public/app/plugins/datasource/tempo/SearchTraceQLEditor/SearchField.tsx @@ -159,7 +159,7 @@ const SearchField = ({ )} value={filter.tag} onChange={(v) => { - updateFilter({ ...filter, tag: v?.value }); + updateFilter({ ...filter, tag: v?.value, value: [] }); }} placeholder="Select tag" isClearable