diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx index 04562cbd26520..ec680b062c9ba 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx +++ b/src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx @@ -99,6 +99,13 @@ describe('DiscoverFieldSearch', () => { expect(badge.text()).toEqual('0'); }); + test('missing switch appears with new fields api', () => { + const component = mountComponent({ ...defaultProps, useNewFieldsApi: true }); + const btn = findTestSubject(component, 'toggleFieldFilterButton'); + btn.simulate('click'); + expect(findTestSubject(component, 'missingSwitch').exists()).toBeTruthy(); + }); + test('change in filters triggers onChange', () => { const onChange = jest.fn(); const component = mountComponent({ ...defaultProps, ...{ onChange } }); diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx index 1e99959d77134..67dda6dd0e9a8 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx +++ b/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx @@ -232,9 +232,6 @@ export function DiscoverFieldSearch({ onChange, value, types, useNewFieldsApi }: }; const footer = () => { - if (useNewFieldsApi) { - return null; - } return (