Skip to content

Commit

Permalink
feat: test of FieldItem without debounced hoc
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Jun 18, 2020
1 parent 78d0582 commit 6112e7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import { act } from 'react-dom/test-utils';
import { EuiLoadingSpinner, EuiPopover } from '@elastic/eui';
import { FieldItem, FieldItemProps } from './field_item';
import { FieldItem, InnerFieldItem, FieldItemProps } from './field_item';
import { coreMock } from 'src/core/public/mocks';
import { mountWithIntl } from 'test_utils/enzyme_helpers';
import { DataPublicPluginStart } from '../../../../../src/plugins/data/public';
Expand Down Expand Up @@ -94,7 +94,7 @@ describe('IndexPattern Field Item', () => {
core.http.post.mockImplementationOnce(() => {
return Promise.resolve({});
});
const wrapper = mountWithIntl(<FieldItem {...defaultProps} />);
const wrapper = mountWithIntl(<InnerFieldItem {...defaultProps} />);

await act(async () => {
wrapper.find('[data-test-subj="lnsFieldListPanelField-bytes"]').simulate('click');
Expand All @@ -119,7 +119,7 @@ describe('IndexPattern Field Item', () => {
});
});

const wrapper = mountWithIntl(<FieldItem {...defaultProps} />);
const wrapper = mountWithIntl(<InnerFieldItem {...defaultProps} />);

wrapper.find('[data-test-subj="lnsFieldListPanelField-bytes"]').simulate('click');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export const InnerFieldItem = function InnerFieldItem(props: FieldItemProps) {
);
};

export const FieldItem = React.memo(debouncedComponent(InnerFieldItem));
export const FieldItem = debouncedComponent(InnerFieldItem);

function FieldItemPopoverContents(props: State & FieldItemProps) {
const {
Expand Down

0 comments on commit 6112e7a

Please sign in to comment.