diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.test.tsx index e8429a54b618..3243c37a04ee 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.test.tsx @@ -12,6 +12,7 @@ import { coreMock } from 'src/core/public/mocks'; describe('ServerLogParamsFields renders', () => { const mocks = coreMock.createSetup(); + const editAction = jest.fn(); test('all params fields is rendered', () => { const actionParams = { @@ -22,7 +23,7 @@ describe('ServerLogParamsFields renders', () => { {}} + editAction={editAction} index={0} defaultMessage={'test default message'} docLinks={{ ELASTIC_WEBSITE_URL: '', DOC_LINK_VERSION: '' } as DocLinksStart} @@ -30,6 +31,7 @@ describe('ServerLogParamsFields renders', () => { http={mocks.http} /> ); + expect(editAction).not.toHaveBeenCalled(); expect(wrapper.find('[data-test-subj="loggingLevelSelect"]').length > 0).toBeTruthy(); expect( wrapper.find('[data-test-subj="loggingLevelSelect"]').first().prop('value') diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.tsx index a3619f96a45b..c4f434f13874 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.tsx @@ -25,7 +25,9 @@ export const ServerLogParamsFields: React.FunctionComponent { - editAction('level', 'info', index); + if (!actionParams?.level) { + editAction('level', 'info', index); + } // eslint-disable-next-line react-hooks/exhaustive-deps }, []);