diff --git a/x-pack/plugins/stack_connectors/public/connector_types/stack/xmatters/xmatters_params.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/stack/xmatters/xmatters_params.test.tsx index 500ee77efbd0d..0c86e59c5aaa3 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/stack/xmatters/xmatters_params.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/stack/xmatters/xmatters_params.test.tsx @@ -11,6 +11,14 @@ import { XmattersSeverityOptions } from '../../types'; import XmattersParamsFields from './xmatters_params'; describe('XmattersParamsFields renders', () => { + beforeAll(() => { + jest.useFakeTimers(); + jest.setSystemTime(new Date('2022-01-01T12:00:00.000Z')); + }); + + afterAll(() => { + jest.useRealTimers(); + }); test('all params fields is rendered', () => { const actionParams = { alertActionGroupName: 'Small t-shirt', @@ -53,4 +61,42 @@ describe('XmattersParamsFields renders', () => { 'test1, test2' ); }); + + test('default params for testing', () => { + const actionParams = {}; + const editAction = jest.fn(); + + mountWithIntl( + + ); + + expect(editAction).toHaveBeenNthCalledWith(1, 'signalId', 'test-alert', 0); + expect(editAction).toHaveBeenNthCalledWith( + 2, + 'alertActionGroupName', + 'test-rule:test-alert', + 0 + ); + expect(editAction).toHaveBeenNthCalledWith(3, 'ruleName', 'Test Rule', 0); + expect(editAction).toHaveBeenNthCalledWith(4, 'date', '2022-01-01T12:00:00.000Z', 0); + expect(editAction).toHaveBeenNthCalledWith(5, 'spaceId', 'test-space', 0); + }); }); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/stack/xmatters/xmatters_params.tsx b/x-pack/plugins/stack_connectors/public/connector_types/stack/xmatters/xmatters_params.tsx index b97db2f349f8e..9b82a45608747 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/stack/xmatters/xmatters_params.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/stack/xmatters/xmatters_params.tsx @@ -78,7 +78,24 @@ const XmattersParamsFields: React.FunctionComponent