Skip to content

Commit

Permalink
[Discover] Always show the "hide missing fields" toggle (#91889) (#92211
Browse files Browse the repository at this point in the history
)

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
Wylie Conlon and kibanamachine authored Feb 22, 2021
1 parent e3bf1a6 commit 5668436
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 } });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ export function DiscoverFieldSearch({ onChange, value, types, useNewFieldsApi }:
};

const footer = () => {
if (useNewFieldsApi) {
return null;
}
return (
<EuiPopoverFooter>
<EuiSwitch
Expand Down

0 comments on commit 5668436

Please sign in to comment.