Skip to content

Commit

Permalink
[Test] Fix console warning in field_editor.test.tsx (#674)
Browse files Browse the repository at this point in the history
Currently, unit test field_editor.test.tsx shows a console warning:

```React.createElement: type is invalid -- expected a string
(for built-in components) or a class/function (for composite components)
but got: undefined. ```

This warning is because EuiCodeEditor is missing in the mock of elastic/eui,
which causes undefined EuiCodeEditor in the test.

PR Resolved:
#673

Signed-off-by: Anan Zhuang <[email protected]>
  • Loading branch information
ananzh authored Jul 28, 2021
1 parent 2b5b672 commit 5b5ac4e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jest.mock('@elastic/eui', () => ({
EuiButtonEmpty: 'eui-button-empty',
EuiCallOut: 'eui-call-out',
EuiCode: 'eui-code',
EuiCodeEditor: 'eui-code-editor',
EuiConfirmModal: 'eui-confirm-modal',
EuiFieldNumber: 'eui-field-number',
EuiFieldText: 'eui-field-text',
Expand Down

0 comments on commit 5b5ac4e

Please sign in to comment.