From ca741ec2bd1cca331b4afe1418222ab8c09a173f Mon Sep 17 00:00:00 2001 From: Anan Zhuang Date: Tue, 27 Jul 2021 05:06:31 +0000 Subject: [PATCH] [1.x][Test] Fix console warning in field_editor.test.tsx 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: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/673 Backport PR: https://github.com/opensearch-project/OpenSearch-Dashboards/pull/674 Signed-off-by: Anan Zhuang --- .../public/components/field_editor/field_editor.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx index 29a6395844af..7c29a7416868 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx +++ b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx @@ -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',