Skip to content

Commit

Permalink
[1.x][Test] Fix console warning in field_editor.test.tsx (#682)
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

Backport PR:
#674

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
  • Loading branch information
ananzh authored Jul 29, 2021
1 parent c11866f commit 933c415
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 933c415

Please sign in to comment.