From f78f8dda364d065d4165a93c6ac2af0956d5d94f Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Mon, 9 Jan 2023 10:28:00 +0100 Subject: [PATCH 01/48] [FEATURE] Detector must have at least one alert set #288 Signed-off-by: Jovan Cvetkovic --- .../ConfigureAlerts/containers/ConfigureAlerts.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/pages/CreateDetector/components/ConfigureAlerts/containers/ConfigureAlerts.tsx b/public/pages/CreateDetector/components/ConfigureAlerts/containers/ConfigureAlerts.tsx index 9cf0ddbc1..5f4ce02b8 100644 --- a/public/pages/CreateDetector/components/ConfigureAlerts/containers/ConfigureAlerts.tsx +++ b/public/pages/CreateDetector/components/ConfigureAlerts/containers/ConfigureAlerts.tsx @@ -130,9 +130,13 @@ export default class ConfigureAlerts extends Component this.onDelete(index)}> - Remove alert trigger - + triggers.length > 1 ? ( + this.onDelete(index)}> + Remove alert trigger + + ) : ( + <> + ) } > From ff8117e65e80e277f47c254cc3c219fe175c1142 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Mon, 23 Jan 2023 20:11:10 +0100 Subject: [PATCH 02/48] [BUG] Create detector | Interval field can be empty #378 Signed-off-by: Jovan Cvetkovic --- .../models/Detectors/InterfacesMock.test.ts | 76 ++ .../AlertTriggerViewMock.test.ts | 29 + .../DetectorBasicDetailsViewMock.test.ts | 9 + .../DetectorRulesViewMock.test.ts | 9 + .../AlertTriggerView.test.tsx | 17 + .../AlertTriggerView.test.tsx.snap | 786 ++++++++++++++++++ .../DetectorBasicDetailsView.test.tsx | 17 + .../DetectorBasicDetailsView.test.tsx.snap | 750 +++++++++++++++++ .../DetectorRulesView.test.tsx | 17 + public/utils/helpers.tsx | 4 +- test/setup.jest.ts | 1 + 11 files changed, 1713 insertions(+), 2 deletions(-) create mode 100644 public/models/Detectors/InterfacesMock.test.ts create mode 100644 public/models/Detectors/components/AlertTriggerView/AlertTriggerViewMock.test.ts create mode 100644 public/models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsViewMock.test.ts create mode 100644 public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts create mode 100644 public/pages/Detectors/components/AlertTriggerView/AlertTriggerView.test.tsx create mode 100644 public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap create mode 100644 public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.test.tsx create mode 100644 public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap create mode 100644 public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx diff --git a/public/models/Detectors/InterfacesMock.test.ts b/public/models/Detectors/InterfacesMock.test.ts new file mode 100644 index 000000000..62df7a73a --- /dev/null +++ b/public/models/Detectors/InterfacesMock.test.ts @@ -0,0 +1,76 @@ +import { + AlertCondition, + Detector, + DetectorInput, + DetectorRuleInfo, + PeriodSchedule, + TriggerAction, +} from '../../../models/interfaces'; + +export const detectorRuleInfoMock: DetectorRuleInfo = { + id: 'detectorRuleId', +}; + +export const detectorInputMock: DetectorInput = { + detector_input: { + description: 'detectorDescription', + indices: ['.windows'], + pre_packaged_rules: [detectorRuleInfoMock], + custom_rules: [detectorRuleInfoMock], + }, +}; + +export const periodScheduleMock: PeriodSchedule = { + period: { + interval: 1, + unit: 'minute', + }, +}; + +export const triggerActionMock: TriggerAction = { + id: 'someId', + // Id of notification channel + destination_id: 'destinationId', + subject_template: { + source: 'sourceTemplate', + lang: 'en-US', + }, + name: 'triggerName', + throttle_enabled: false, + message_template: { + source: 'messageSource', + lang: 'en-US', + }, + throttle: { + unit: 'throttleUnit', + value: 1, + }, +}; + +export const alertConditionMock: AlertCondition = { + // Trigger fields + name: 'alertName', + + // Detector types + types: ['detectorType1'], + + // Trigger fields based on Rules + sev_levels: ['low'], + tags: ['any.tag'], + ids: ['ruleId1'], + + // Alert related fields + actions: [triggerActionMock, triggerActionMock], + severity: 'low', +}; + +export const detectorMock: Detector = { + type: 'detector', + detector_type: '.windows', + name: 'detectorName', + enabled: true, + createdBy: 'testUser', + schedule: periodScheduleMock, + inputs: [detectorInputMock], + triggers: [alertConditionMock, alertConditionMock], +}; diff --git a/public/models/Detectors/components/AlertTriggerView/AlertTriggerViewMock.test.ts b/public/models/Detectors/components/AlertTriggerView/AlertTriggerViewMock.test.ts new file mode 100644 index 000000000..b7f0c601d --- /dev/null +++ b/public/models/Detectors/components/AlertTriggerView/AlertTriggerViewMock.test.ts @@ -0,0 +1,29 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { RuleInfo, RuleSource } from '../../../../../server/models/interfaces'; +import { alertConditionMock, detectorMock } from '../../InterfacesMock.test'; + +const ruleSource: RuleSource = { + rule: 'ruleName', + last_update_time: '12/12/2022', + queries: [{ value: '.windows' }], +}; + +const ruleInfo: RuleInfo = { + _id: 'ruleId', + _index: '.windows', + _primary_term: 1, + _source: ruleSource, + _version: 1, +}; + +export default { + alertTrigger: alertConditionMock, + orderPosition: 1, + detector: detectorMock, + notificationChannels: [], + rules: { rileId: ruleInfo }, +}; diff --git a/public/models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsViewMock.test.ts b/public/models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsViewMock.test.ts new file mode 100644 index 000000000..0ce91083d --- /dev/null +++ b/public/models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsViewMock.test.ts @@ -0,0 +1,9 @@ +import { detectorMock } from '../../InterfacesMock.test'; + +export default { + detector: detectorMock, + rulesCanFold: true, + enabled_time: 1, + last_update_time: 1, + onEditClicked: () => jest.fn(), +}; diff --git a/public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts b/public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts new file mode 100644 index 000000000..7cd0ed1e0 --- /dev/null +++ b/public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts @@ -0,0 +1,9 @@ +import { detectorMock } from '../../InterfacesMock.test'; + +const notificationsStart: NotificationsStart = {}; +export default { + detector: detectorMock, + rulesCanFold: true, + onEditClicked: jest.fn(), + notifications: notificationsStart, +}; diff --git a/public/pages/Detectors/components/AlertTriggerView/AlertTriggerView.test.tsx b/public/pages/Detectors/components/AlertTriggerView/AlertTriggerView.test.tsx new file mode 100644 index 000000000..23c4a6f5f --- /dev/null +++ b/public/pages/Detectors/components/AlertTriggerView/AlertTriggerView.test.tsx @@ -0,0 +1,17 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { AlertTriggerView } from './AlertTriggerView'; +import props from '../../../../models/Detectors/components/AlertTriggerView/AlertTriggerViewMock.test'; +import { expect } from '@jest/globals'; + +describe(' spec', () => { + it('renders the component', () => { + const view = render(); + expect(view).toMatchSnapshot(); + }); +}); diff --git a/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap b/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap new file mode 100644 index 000000000..9a2175402 --- /dev/null +++ b/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap @@ -0,0 +1,786 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` spec renders the component 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+ alertName +
+
+
+
+
+ If any detection rule matches +
+
+
+
+
+
+ +
+
+
+ detectorType1 +
+
+
+
+
+
+
+ +
+
+
+ - +
+
+
+
+
+
+
+
+
+
+ +
+
+
+ low +
+
+
+
+
+
+
+ +
+
+
+ any.tag +
+
+
+
+
+
+
+
+ Alert and notify +
+
+
+
+ +
+
+
+ - +
+
+
+
+
+
+ +
+
+
+
+ - +
+
+
+
+
+
+
+
+
+
+
+ , + "container":
+
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+ alertName +
+
+
+
+
+ If any detection rule matches +
+
+
+
+
+
+ +
+
+
+ detectorType1 +
+
+
+
+
+
+
+ +
+
+
+ - +
+
+
+
+
+
+
+
+
+
+ +
+
+
+ low +
+
+
+
+
+
+
+ +
+
+
+ any.tag +
+
+
+
+
+
+
+
+ Alert and notify +
+
+
+
+ +
+
+
+ - +
+
+
+
+
+
+ +
+
+
+
+ - +
+
+
+
+
+
+
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.test.tsx b/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.test.tsx new file mode 100644 index 000000000..2c5b52d6b --- /dev/null +++ b/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.test.tsx @@ -0,0 +1,17 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { DetectorBasicDetailsView } from './DetectorBasicDetailsView'; +import props from '../../../../models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsViewMock.test'; +import { expect } from '@jest/globals'; + +describe(' spec', () => { + it('renders the component', () => { + const view = render(); + expect(view).toMatchSnapshot(); + }); +}); diff --git a/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap b/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap new file mode 100644 index 000000000..8ee60a211 --- /dev/null +++ b/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap @@ -0,0 +1,750 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` spec renders the component 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+
+
+

+ Detector details +

+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ detectorName +
+
+
+
+
+
+
+ +
+
+
+ .windows +
+
+
+
+
+
+
+ +
+
+
+ .windows +
+
+
+
+
+
+
+
+
+
+ +
+
+
+ detectorDescription +
+
+
+
+
+
+
+ +
+
+
+ Every 1 minute +
+
+
+
+
+
+
+ +
+
+
+ 1970-01-01T01:00 +
+
+
+
+
+
+
+ +
+
+
+ 1970-01-01T01:00 +
+
+
+
+
+
+
+
+
+ , + "container":
+
+
+
+

+ Detector details +

+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ detectorName +
+
+
+
+
+
+
+ +
+
+
+ .windows +
+
+
+
+
+
+
+ +
+
+
+ .windows +
+
+
+
+
+
+
+
+
+
+ +
+
+
+ detectorDescription +
+
+
+
+
+
+
+ +
+
+
+ Every 1 minute +
+
+
+
+
+
+
+ +
+
+
+ 1970-01-01T01:00 +
+
+
+
+
+
+
+ +
+
+
+ 1970-01-01T01:00 +
+
+
+
+
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx b/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx new file mode 100644 index 000000000..2350a4557 --- /dev/null +++ b/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx @@ -0,0 +1,17 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import props from '../../../../models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test'; +import { expect } from '@jest/globals'; +import { DetectorRulesView } from './DetectorRulesView'; + +describe(' spec', () => { + it('renders the component', () => { + const view = render(); + expect(view).toMatchSnapshot(); + }); +}); diff --git a/public/utils/helpers.tsx b/public/utils/helpers.tsx index b45c94660..6eef34f9a 100644 --- a/public/utils/helpers.tsx +++ b/public/utils/helpers.tsx @@ -23,7 +23,7 @@ import { } from '../pages/CreateDetector/components/DefineDetector/components/DetectionRules/types/interfaces'; import { compile, TopLevelSpec } from 'vega-lite'; import { parse, View } from 'vega/build-es5/vega.js'; -import { expressionInterpreter as vegaExpressionInterpreter } from 'vega-interpreter/build/vega-interpreter.module'; +import { expressionInterpreter as vegaExpressionInterpreter } from 'vega-interpreter/build/vega-interpreter'; import { RuleInfo } from '../../server/models/interfaces'; import { NotificationsStart } from 'opensearch-dashboards/public'; import { OpenSearchService } from '../services'; @@ -44,7 +44,7 @@ export function createTextDetailsGroup( columnNum?: number ) { const createFormRow = (label: string, content: string, url?: string) => { - const dataTestSubj = label.toLowerCase().replaceAll(' ', '-'); + const dataTestSubj = label.toLowerCase().replace('/ /g', '-'); return ( {label}}> {url ? ( diff --git a/test/setup.jest.ts b/test/setup.jest.ts index 5817c53f4..08e4a8ffe 100644 --- a/test/setup.jest.ts +++ b/test/setup.jest.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import 'jest-canvas-mock'; import '@testing-library/jest-dom/extend-expect'; import { configure } from '@testing-library/react'; From b308059fcc619fbbda46b48a8b8da13a0e54a1e2 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Tue, 24 Jan 2023 08:04:21 +0100 Subject: [PATCH 03/48] Adjust styling for Finding details flyout #369 Signed-off-by: Jovan Cvetkovic --- .../DetectorRulesViewMock.test.ts | 4 +- .../FieldMappingsViewMock.test.ts | 16 + .../FieldMappingsView.test.tsx | 17 + .../FieldMappingsView.test.tsx.snap | 468 ++++++++++++++++++ 4 files changed, 504 insertions(+), 1 deletion(-) create mode 100644 public/models/Detectors/components/FieldMappingsView/FieldMappingsViewMock.test.ts create mode 100644 public/pages/Detectors/components/FieldMappingsView/FieldMappingsView.test.tsx create mode 100644 public/pages/Detectors/components/FieldMappingsView/__snapshots__/FieldMappingsView.test.tsx.snap diff --git a/public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts b/public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts index 7cd0ed1e0..d0688d7ec 100644 --- a/public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts +++ b/public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts @@ -1,6 +1,8 @@ import { detectorMock } from '../../InterfacesMock.test'; -const notificationsStart: NotificationsStart = {}; +const notificationsStart = { + toasts: [], +}; export default { detector: detectorMock, rulesCanFold: true, diff --git a/public/models/Detectors/components/FieldMappingsView/FieldMappingsViewMock.test.ts b/public/models/Detectors/components/FieldMappingsView/FieldMappingsViewMock.test.ts new file mode 100644 index 000000000..294df7d1f --- /dev/null +++ b/public/models/Detectors/components/FieldMappingsView/FieldMappingsViewMock.test.ts @@ -0,0 +1,16 @@ +import { FieldMapping } from '../../../../../models/interfaces'; +import { detectorMock } from '../../InterfacesMock.test'; +const notificationsStart = { + toasts: [], +}; + +const fieldMapping: FieldMapping = { + indexFieldName: 'indexFieldName', + ruleFieldName: 'ruleFieldName', +}; +export default { + detector: detectorMock, + existingMappings: [fieldMapping, fieldMapping], + editFieldMappings: jest.fn(), + notifications: notificationsStart, +}; diff --git a/public/pages/Detectors/components/FieldMappingsView/FieldMappingsView.test.tsx b/public/pages/Detectors/components/FieldMappingsView/FieldMappingsView.test.tsx new file mode 100644 index 000000000..a66339994 --- /dev/null +++ b/public/pages/Detectors/components/FieldMappingsView/FieldMappingsView.test.tsx @@ -0,0 +1,17 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import props from '../../../../models/Detectors/components/FieldMappingsView/FieldMappingsViewMock.test'; +import { expect } from '@jest/globals'; +import { FieldMappingsView } from './FieldMappingsView'; + +describe(' spec', () => { + it('renders the component', () => { + const view = render(); + expect(view).toMatchSnapshot(); + }); +}); diff --git a/public/pages/Detectors/components/FieldMappingsView/__snapshots__/FieldMappingsView.test.tsx.snap b/public/pages/Detectors/components/FieldMappingsView/__snapshots__/FieldMappingsView.test.tsx.snap new file mode 100644 index 000000000..9c356e54c --- /dev/null +++ b/public/pages/Detectors/components/FieldMappingsView/__snapshots__/FieldMappingsView.test.tsx.snap @@ -0,0 +1,468 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` spec renders the component 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+
+
+

+ Field mapping +

+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + Rule field name + + + + + + Mapped index field name + + +
+
+ Rule field name +
+
+ + ruleFieldName + +
+
+
+ Mapped index field name +
+
+ + indexFieldName + +
+
+
+ Rule field name +
+
+ + ruleFieldName + +
+
+
+ Mapped index field name +
+
+ + indexFieldName + +
+
+
+
+
+
+
+ , + "container":
+
+
+
+

+ Field mapping +

+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + + Rule field name + + + + + + Mapped index field name + + +
+
+ Rule field name +
+
+ + ruleFieldName + +
+
+
+ Mapped index field name +
+
+ + indexFieldName + +
+
+
+ Rule field name +
+
+ + ruleFieldName + +
+
+
+ Mapped index field name +
+
+ + indexFieldName + +
+
+
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; From 7a417443a509491c62730838e0c99e8222f96736 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Tue, 24 Jan 2023 12:15:35 +0100 Subject: [PATCH 04/48] unit tests Signed-off-by: Jovan Cvetkovic --- .../UpdateAlertConditionsMock.test.ts | 42 +++++++++++++++++++ .../UpdateAlertConditions.test.tsx | 17 ++++++++ 2 files changed, 59 insertions(+) create mode 100644 public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditionsMock.test.ts create mode 100644 public/pages/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.test.tsx diff --git a/public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditionsMock.test.ts b/public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditionsMock.test.ts new file mode 100644 index 000000000..45f6372c5 --- /dev/null +++ b/public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditionsMock.test.ts @@ -0,0 +1,42 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { + DetectorsService, + NotificationsService, + OpenSearchService, + RuleService, +} from '../../../../services'; +import { DetectorHit, DetectorResponse } from '../../../../../server/models/interfaces'; +import { alertConditionMock, detectorMock } from '../../InterfacesMock.test'; + +const notificationsStart = { + toasts: [], +}; +const detectorResponse: DetectorResponse = { + last_update_time: 1, + enabled_time: 1, + ...detectorMock, +}; + +const detectorHit: DetectorHit = { + _index: '.windows', + _source: detectorResponse, + _id: 'detectorHitId', +}; + +export default { + detectorHit: detectorHit, + detectorService: DetectorsService, + opensearchService: OpenSearchService, + ruleService: RuleService, + notificationsService: NotificationsService, + notifications: notificationsStart, + location: { + state: { + detectorHit: detectorHit, + }, + }, +}; diff --git a/public/pages/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.test.tsx b/public/pages/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.test.tsx new file mode 100644 index 000000000..14e42d7c5 --- /dev/null +++ b/public/pages/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.test.tsx @@ -0,0 +1,17 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import props from '../../../../models/Detectors/components/UpdateAlertConditions/UpdateAlertConditionsMock.test'; +import { expect } from '@jest/globals'; +import UpdateAlertConditions from './UpdateAlertConditions'; + +describe(' spec', () => { + it('renders the component', () => { + const view = render(); + expect(view).toMatchSnapshot(); + }); +}); From 06be7dade9b783ca586fc73420c2e762ae2a6216 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Wed, 25 Jan 2023 13:44:18 +0100 Subject: [PATCH 05/48] detector unit tests Signed-off-by: Jovan Cvetkovic --- ...wMock.test.ts => AlertTriggerView.mock.ts} | 2 +- ...st.ts => DetectorBasicDetailsView.mock.ts} | 2 +- ...Mock.test.ts => DetectorRulesView.mock.ts} | 5 +- ...Mock.test.ts => FieldMappingsView.mock.ts} | 5 +- .../UpdateAlertConditions.mock.ts | 49 + .../UpdateAlertConditionsMock.test.ts | 42 - ...erfacesMock.test.ts => Interfaces.mock.ts} | 21 +- .../AlertTriggerView.test.tsx | 2 +- .../AlertTriggerView.test.tsx.snap | 4 +- .../DetectorBasicDetailsView.test.tsx | 2 +- .../DetectorBasicDetailsView.test.tsx.snap | 8 +- .../DetectorRulesView.test.tsx | 3 +- .../DetectorRulesView.test.tsx.snap | 846 ++++ .../FieldMappingsView.test.tsx | 2 +- .../UpdateAlertConditions.test.tsx | 2 +- .../UpdateAlertConditions.test.tsx.snap | 3646 +++++++++++++++++ public/pages/Overview/utils/helper.test.ts | 8 +- test/setup.jest.ts | 51 + 18 files changed, 4631 insertions(+), 69 deletions(-) rename public/models/Detectors/components/AlertTriggerView/{AlertTriggerViewMock.test.ts => AlertTriggerView.mock.ts} (88%) rename public/models/Detectors/components/DetectorBasicDetailsView/{DetectorBasicDetailsViewMock.test.ts => DetectorBasicDetailsView.mock.ts} (71%) rename public/models/Detectors/components/DetectorRulesView/{DetectorRulesViewMock.test.ts => DetectorRulesView.mock.ts} (56%) rename public/models/Detectors/components/FieldMappingsView/{FieldMappingsViewMock.test.ts => FieldMappingsView.mock.ts} (76%) create mode 100644 public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts delete mode 100644 public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditionsMock.test.ts rename public/models/{Detectors/InterfacesMock.test.ts => Interfaces.mock.ts} (78%) create mode 100644 public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap create mode 100644 public/pages/Detectors/components/UpdateAlertConditions/__snapshots__/UpdateAlertConditions.test.tsx.snap diff --git a/public/models/Detectors/components/AlertTriggerView/AlertTriggerViewMock.test.ts b/public/models/Detectors/components/AlertTriggerView/AlertTriggerView.mock.ts similarity index 88% rename from public/models/Detectors/components/AlertTriggerView/AlertTriggerViewMock.test.ts rename to public/models/Detectors/components/AlertTriggerView/AlertTriggerView.mock.ts index b7f0c601d..30e4edea3 100644 --- a/public/models/Detectors/components/AlertTriggerView/AlertTriggerViewMock.test.ts +++ b/public/models/Detectors/components/AlertTriggerView/AlertTriggerView.mock.ts @@ -4,7 +4,7 @@ */ import { RuleInfo, RuleSource } from '../../../../../server/models/interfaces'; -import { alertConditionMock, detectorMock } from '../../InterfacesMock.test'; +import { alertConditionMock, detectorMock } from '../../../Interfaces.mock'; const ruleSource: RuleSource = { rule: 'ruleName', diff --git a/public/models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsViewMock.test.ts b/public/models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.mock.ts similarity index 71% rename from public/models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsViewMock.test.ts rename to public/models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.mock.ts index 0ce91083d..80d0d785b 100644 --- a/public/models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsViewMock.test.ts +++ b/public/models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.mock.ts @@ -1,4 +1,4 @@ -import { detectorMock } from '../../InterfacesMock.test'; +import { detectorMock } from '../../../Interfaces.mock'; export default { detector: detectorMock, diff --git a/public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts b/public/models/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts similarity index 56% rename from public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts rename to public/models/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts index d0688d7ec..133d9a904 100644 --- a/public/models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test.ts +++ b/public/models/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts @@ -1,8 +1,5 @@ -import { detectorMock } from '../../InterfacesMock.test'; +import { detectorMock, notificationsStart } from '../../../Interfaces.mock'; -const notificationsStart = { - toasts: [], -}; export default { detector: detectorMock, rulesCanFold: true, diff --git a/public/models/Detectors/components/FieldMappingsView/FieldMappingsViewMock.test.ts b/public/models/Detectors/components/FieldMappingsView/FieldMappingsView.mock.ts similarity index 76% rename from public/models/Detectors/components/FieldMappingsView/FieldMappingsViewMock.test.ts rename to public/models/Detectors/components/FieldMappingsView/FieldMappingsView.mock.ts index 294df7d1f..2f198d6b7 100644 --- a/public/models/Detectors/components/FieldMappingsView/FieldMappingsViewMock.test.ts +++ b/public/models/Detectors/components/FieldMappingsView/FieldMappingsView.mock.ts @@ -1,8 +1,5 @@ import { FieldMapping } from '../../../../../models/interfaces'; -import { detectorMock } from '../../InterfacesMock.test'; -const notificationsStart = { - toasts: [], -}; +import { detectorMock, notificationsStart } from '../../../Interfaces.mock'; const fieldMapping: FieldMapping = { indexFieldName: 'indexFieldName', diff --git a/public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts b/public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts new file mode 100644 index 000000000..0f5fe1e63 --- /dev/null +++ b/public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { + DetectorsService, + NotificationsService, + OpenSearchService, + RuleService, +} from '../../../../services'; +import { mockDetectorHit, notificationsStart } from '../../../Interfaces.mock'; + +const notificationsService: NotificationsService = { + getChannels: () => { + return { + ok: true, + response: { + channel_list: [], + }, + }; + }, +}; + +const ruleService: RuleService = { + getRules: () => { + return { + ok: true, + response: { + hits: { + hits: [], + }, + }, + }; + }, +}; +export default { + detectorHit: mockDetectorHit, + detectorService: DetectorsService, + opensearchService: OpenSearchService, + ruleService: ruleService, + notificationsService: notificationsService, + notifications: notificationsStart, + location: { + state: { + detectorHit: mockDetectorHit, + }, + }, +}; diff --git a/public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditionsMock.test.ts b/public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditionsMock.test.ts deleted file mode 100644 index 45f6372c5..000000000 --- a/public/models/Detectors/components/UpdateAlertConditions/UpdateAlertConditionsMock.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { - DetectorsService, - NotificationsService, - OpenSearchService, - RuleService, -} from '../../../../services'; -import { DetectorHit, DetectorResponse } from '../../../../../server/models/interfaces'; -import { alertConditionMock, detectorMock } from '../../InterfacesMock.test'; - -const notificationsStart = { - toasts: [], -}; -const detectorResponse: DetectorResponse = { - last_update_time: 1, - enabled_time: 1, - ...detectorMock, -}; - -const detectorHit: DetectorHit = { - _index: '.windows', - _source: detectorResponse, - _id: 'detectorHitId', -}; - -export default { - detectorHit: detectorHit, - detectorService: DetectorsService, - opensearchService: OpenSearchService, - ruleService: RuleService, - notificationsService: NotificationsService, - notifications: notificationsStart, - location: { - state: { - detectorHit: detectorHit, - }, - }, -}; diff --git a/public/models/Detectors/InterfacesMock.test.ts b/public/models/Interfaces.mock.ts similarity index 78% rename from public/models/Detectors/InterfacesMock.test.ts rename to public/models/Interfaces.mock.ts index 62df7a73a..5cf1251d5 100644 --- a/public/models/Detectors/InterfacesMock.test.ts +++ b/public/models/Interfaces.mock.ts @@ -5,7 +5,8 @@ import { DetectorRuleInfo, PeriodSchedule, TriggerAction, -} from '../../../models/interfaces'; +} from '../../models/interfaces'; +import { DetectorHit, DetectorResponse } from '../../server/models/interfaces'; export const detectorRuleInfoMock: DetectorRuleInfo = { id: 'detectorRuleId', @@ -61,7 +62,7 @@ export const alertConditionMock: AlertCondition = { // Alert related fields actions: [triggerActionMock, triggerActionMock], - severity: 'low', + severity: '1', }; export const detectorMock: Detector = { @@ -74,3 +75,19 @@ export const detectorMock: Detector = { inputs: [detectorInputMock], triggers: [alertConditionMock, alertConditionMock], }; + +export const detectorResponse: DetectorResponse = { + last_update_time: 1, + enabled_time: 1, + ...detectorMock, +}; + +export const mockDetectorHit: DetectorHit = { + _index: '.windows', + _source: detectorResponse, + _id: 'detectorHitId', +}; + +export const notificationsStart = { + toasts: [], +}; diff --git a/public/pages/Detectors/components/AlertTriggerView/AlertTriggerView.test.tsx b/public/pages/Detectors/components/AlertTriggerView/AlertTriggerView.test.tsx index 23c4a6f5f..65829630e 100644 --- a/public/pages/Detectors/components/AlertTriggerView/AlertTriggerView.test.tsx +++ b/public/pages/Detectors/components/AlertTriggerView/AlertTriggerView.test.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { AlertTriggerView } from './AlertTriggerView'; -import props from '../../../../models/Detectors/components/AlertTriggerView/AlertTriggerViewMock.test'; +import props from '../../../../models/Detectors/components/AlertTriggerView/AlertTriggerView.mock'; import { expect } from '@jest/globals'; describe(' spec', () => { diff --git a/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap b/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap index 9a2175402..1680d1723 100644 --- a/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap +++ b/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap @@ -313,7 +313,7 @@ Object { data-test-subj="text-details-group-content-trigger alerts with severity" id="some_html_id" > - - + 1 (Highest)
@@ -677,7 +677,7 @@ Object { data-test-subj="text-details-group-content-trigger alerts with severity" id="some_html_id" > - - + 1 (Highest)
diff --git a/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.test.tsx b/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.test.tsx index 2c5b52d6b..6edfa4213 100644 --- a/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.test.tsx +++ b/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.test.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { DetectorBasicDetailsView } from './DetectorBasicDetailsView'; -import props from '../../../../models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsViewMock.test'; +import props from '../../../../models/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.mock'; import { expect } from '@jest/globals'; describe(' spec', () => { diff --git a/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap b/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap index 8ee60a211..ef450303a 100644 --- a/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap +++ b/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap @@ -298,7 +298,7 @@ Object { data-test-subj="text-details-group-content-created at" id="some_html_id" > - 1970-01-01T01:00 + 2023-01-25T10:05
@@ -337,7 +337,7 @@ Object { data-test-subj="text-details-group-content-last updated time" id="some_html_id" > - 1970-01-01T01:00 + 2023-01-25T10:05
@@ -644,7 +644,7 @@ Object { data-test-subj="text-details-group-content-created at" id="some_html_id" > - 1970-01-01T01:00 + 2023-01-25T10:05
@@ -683,7 +683,7 @@ Object { data-test-subj="text-details-group-content-last updated time" id="some_html_id" > - 1970-01-01T01:00 + 2023-01-25T10:05
diff --git a/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx b/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx index 2350a4557..4304978f5 100644 --- a/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx +++ b/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx @@ -5,9 +5,10 @@ import React from 'react'; import { render } from '@testing-library/react'; -import props from '../../../../models/Detectors/components/DetectorRulesView/DetectorRulesViewMock.test'; +import props from '../../../../models/Detectors/components/DetectorRulesView/DetectorRulesView.mock'; import { expect } from '@jest/globals'; import { DetectorRulesView } from './DetectorRulesView'; +jest.mock('../../../Rules/models/RulesViewModelActor.ts'); describe(' spec', () => { it('renders the component', () => { diff --git a/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap b/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap new file mode 100644 index 000000000..800394bb9 --- /dev/null +++ b/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap @@ -0,0 +1,846 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` spec renders the component 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+ + EuiIconMock + +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + Description + + +
+
+ + No items found + +
+
+
+
+
+
+
+
+
+
+
+ , + "container":
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+ + EuiIconMock + +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + Description + + +
+
+ + No items found + +
+
+
+
+
+
+
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/public/pages/Detectors/components/FieldMappingsView/FieldMappingsView.test.tsx b/public/pages/Detectors/components/FieldMappingsView/FieldMappingsView.test.tsx index a66339994..86f70e9c6 100644 --- a/public/pages/Detectors/components/FieldMappingsView/FieldMappingsView.test.tsx +++ b/public/pages/Detectors/components/FieldMappingsView/FieldMappingsView.test.tsx @@ -5,7 +5,7 @@ import React from 'react'; import { render } from '@testing-library/react'; -import props from '../../../../models/Detectors/components/FieldMappingsView/FieldMappingsViewMock.test'; +import props from '../../../../models/Detectors/components/FieldMappingsView/FieldMappingsView.mock'; import { expect } from '@jest/globals'; import { FieldMappingsView } from './FieldMappingsView'; diff --git a/public/pages/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.test.tsx b/public/pages/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.test.tsx index 14e42d7c5..369b35e57 100644 --- a/public/pages/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.test.tsx +++ b/public/pages/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.test.tsx @@ -5,7 +5,7 @@ import React from 'react'; import { render } from '@testing-library/react'; -import props from '../../../../models/Detectors/components/UpdateAlertConditions/UpdateAlertConditionsMock.test'; +import props from '../../../../models/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock'; import { expect } from '@jest/globals'; import UpdateAlertConditions from './UpdateAlertConditions'; diff --git a/public/pages/Detectors/components/UpdateAlertConditions/__snapshots__/UpdateAlertConditions.test.tsx.snap b/public/pages/Detectors/components/UpdateAlertConditions/__snapshots__/UpdateAlertConditions.test.tsx.snap new file mode 100644 index 000000000..2e2d75f10 --- /dev/null +++ b/public/pages/Detectors/components/UpdateAlertConditions/__snapshots__/UpdateAlertConditions.test.tsx.snap @@ -0,0 +1,3646 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` spec renders the component 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+
+

+ Set up alerts (2) +

+
+
+ Get notified when specific rule conditions are found by the detector. +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+

+ If a detection rule matches +

+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+

+ Alert and notify +

+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+ +
+
+
+ +
+
+
+
+
+ EuiIconMock + + Notifications plugin is not installed + +
+
+
+

+ Install the notifications plugin in order to create and select channels to send out notifications.  + + Learn more + EuiIconMock + + . +

+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+

+ If a detection rule matches +

+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+

+ Alert and notify +

+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+ +
+
+
+ +
+
+
+
+
+ EuiIconMock + + Notifications plugin is not installed + +
+
+
+

+ Install the notifications plugin in order to create and select channels to send out notifications.  + + Learn more + EuiIconMock + + . +

+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+ , + "container":
+
+
+

+ Set up alerts (2) +

+
+
+ Get notified when specific rule conditions are found by the detector. +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+

+ If a detection rule matches +

+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+

+ Alert and notify +

+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+ +
+
+
+ +
+
+
+
+
+ EuiIconMock + + Notifications plugin is not installed + +
+
+
+

+ Install the notifications plugin in order to create and select channels to send out notifications.  + + Learn more + EuiIconMock + + . +

+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+

+ If a detection rule matches +

+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+

+ Alert and notify +

+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+ +
+
+
+ +
+
+
+
+
+ EuiIconMock + + Notifications plugin is not installed + +
+
+
+

+ Install the notifications plugin in order to create and select channels to send out notifications.  + + Learn more + EuiIconMock + + . +

+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/public/pages/Overview/utils/helper.test.ts b/public/pages/Overview/utils/helper.test.ts index f5c7f413f..88ec7e93a 100644 --- a/public/pages/Overview/utils/helper.test.ts +++ b/public/pages/Overview/utils/helper.test.ts @@ -3,7 +3,6 @@ import { DateOpts, getAlertsVisualizationSpec, getChartTimeUnit, - getDomainRange, getFindingsVisualizationSpec, getOverviewVisualizationSpec, getTimeTooltip, @@ -127,9 +126,10 @@ describe('helper utilities spec', () => { describe('tests parseDateString function', () => { it(' - function should return datetime in ms', () => { - const time = moment(10); - jest.spyOn(dateMath, 'parse').mockReturnValue(time); - expect(parseDateString(DEFAULT_DATE_RANGE.start)).toBe(time.milliseconds()); + const mockTime = moment('2023-01-25T10:05:00'); + jest.spyOn(dateMath, 'parse').mockReturnValue(mockTime); + jest.fn().mockImplementation('parseDateString', () => mockTime.milliseconds()); + expect(parseDateString(DEFAULT_DATE_RANGE.start)).toBe(mockTime._d.getTime()); }); }); diff --git a/test/setup.jest.ts b/test/setup.jest.ts index 08e4a8ffe..6697e8525 100644 --- a/test/setup.jest.ts +++ b/test/setup.jest.ts @@ -6,6 +6,7 @@ import 'jest-canvas-mock'; import '@testing-library/jest-dom/extend-expect'; import { configure } from '@testing-library/react'; +import { mockDetectorHit } from '../public/models/Interfaces.mock'; configure({ testIdAttribute: 'data-test-subj' }); @@ -41,4 +42,54 @@ jest.mock('@elastic/eui/lib/eui_components/icon', () => ({ ICON_COLORS: require('@elastic/eui/lib/eui_components/icon/icon').COLORS, })); +jest.mock('moment', () => { + const moment = jest.requireActual('moment'); + + // Set moment tz mock + if (!moment.tz) moment.tz = {}; + moment.tz.names = () => ['Pacific/Tahiti']; + const momentInstance = moment(); + + momentInstance.format = jest.fn().mockReturnValue('2023-01-25T10:05'); + + function fakeMoment() { + return momentInstance; + } + + Object.assign(fakeMoment, moment); + + return fakeMoment; +}); + +jest.mock('react', () => { + const ActualReact = jest.requireActual('react'); + return { + ...ActualReact, + useContext: () => ({ + indexService: { + getIndices: () => { + return { + ok: true, + response: { + indices: [], + }, + }; + }, + }, + detectorsService: { + getDetectors: () => { + return { + ok: true, + response: { + hits: { + hits: [mockDetectorHit], + }, + }, + }; + }, + }, + }), + }; +}); + jest.setTimeout(10000); // in milliseconds From 6bf765e4d82dda53babd47325bb66b7307619d05 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Thu, 26 Jan 2023 08:17:51 +0100 Subject: [PATCH 06/48] detector unit tests Signed-off-by: Jovan Cvetkovic --- .../DetectorRulesView.mock.ts | 2 +- .../UpdateDetectorRules.mock.ts | 14 + .../DetectorRulesView.test.tsx | 9 +- .../DetectorRulesView.test.tsx.snap | 1222 +++++++++-------- .../UpdateRules/UpdateDetectorRules.test.tsx | 17 + .../UpdateDetectorRules.test.tsx.snap | 762 ++++++++++ test/mocks/httpClientMock.ts | 1 - test/setup.jest.ts | 15 + tsconfig.json | 2 +- 9 files changed, 1430 insertions(+), 614 deletions(-) create mode 100644 public/models/Detectors/components/UpdateDetectorRules/UpdateDetectorRules.mock.ts create mode 100644 public/pages/Detectors/components/UpdateRules/UpdateDetectorRules.test.tsx create mode 100644 public/pages/Detectors/components/UpdateRules/__snapshots__/UpdateDetectorRules.test.tsx.snap diff --git a/public/models/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts b/public/models/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts index 133d9a904..7e774fee5 100644 --- a/public/models/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts +++ b/public/models/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts @@ -2,7 +2,7 @@ import { detectorMock, notificationsStart } from '../../../Interfaces.mock'; export default { detector: detectorMock, - rulesCanFold: true, + rulesCanFold: false, onEditClicked: jest.fn(), notifications: notificationsStart, }; diff --git a/public/models/Detectors/components/UpdateDetectorRules/UpdateDetectorRules.mock.ts b/public/models/Detectors/components/UpdateDetectorRules/UpdateDetectorRules.mock.ts new file mode 100644 index 000000000..a95beb3a6 --- /dev/null +++ b/public/models/Detectors/components/UpdateDetectorRules/UpdateDetectorRules.mock.ts @@ -0,0 +1,14 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { mockDetectorHit, notificationsStart } from '../../../Interfaces.mock'; + +export default { + notifications: notificationsStart, + detectorHit: mockDetectorHit, + location: { + pathname: '', + }, +}; diff --git a/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx b/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx index 4304978f5..2327f68c9 100644 --- a/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx +++ b/public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.test.tsx @@ -8,11 +8,14 @@ import { render } from '@testing-library/react'; import props from '../../../../models/Detectors/components/DetectorRulesView/DetectorRulesView.mock'; import { expect } from '@jest/globals'; import { DetectorRulesView } from './DetectorRulesView'; -jest.mock('../../../Rules/models/RulesViewModelActor.ts'); +import { act } from 'react-dom/test-utils'; describe(' spec', () => { - it('renders the component', () => { - const view = render(); + it('renders the component', async () => { + let view; + act(() => { + view = render(); + }); expect(view).toMatchSnapshot(); }); }); diff --git a/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap b/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap index 800394bb9..432da818b 100644 --- a/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap +++ b/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap @@ -6,390 +6,393 @@ Object { "baseElement":
-
+
+
-

- View detection rules (2) -

+
- - +
+
+
-
-
-
+
+
-
+
+
-
- -
- - EuiIconMock - -
-
+ EuiIconMock +
+
+
+
+
-
-
- -
-
-
+ + +
+
+
+
+ -
-
-
+ + +
+
+
+
+ -
-
+ + +
+
+
+
+
+
-
-
+
+
-
-
-
- -
-
-
-
-
-
- - - - - + + + + + + + +
-
- + + + + + + + + + - + - + - + - - - - + + + - - -
+
+ - + + + + - + + + + - + + + +
+ - -
- - No items found - -
-
- - + Description + + +
+
+ + No items found + +
+
@@ -400,390 +403,393 @@ Object { , "container":
-
+
+
-

- View detection rules (2) -

+
- - +
+
+
-
-
-
+
+
-
+
+
-
- -
- - EuiIconMock - -
-
+ EuiIconMock +
+
+
+
+
-
-
- -
-
-
+ + +
+
+
+
+ -
-
-
+ + +
+
+
+
+ -
-
+ + +
+
+
+
+
+
-
-
+
+
-
-
-
- -
-
-
-
-
-
- - - - - + + + + + + + +
-
- + + + + + + + + + - + - + - + - - - - + + + - - -
+
+ - + + + + - + + + + - + + + +
+ - -
- - No items found - -
-
- - + Description + + +
+
+ + No items found + +
+
diff --git a/public/pages/Detectors/components/UpdateRules/UpdateDetectorRules.test.tsx b/public/pages/Detectors/components/UpdateRules/UpdateDetectorRules.test.tsx new file mode 100644 index 000000000..eccc79984 --- /dev/null +++ b/public/pages/Detectors/components/UpdateRules/UpdateDetectorRules.test.tsx @@ -0,0 +1,17 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import props from '../../../../models/Detectors/components/UpdateDetectorRules/UpdateDetectorRules.mock'; +import { expect } from '@jest/globals'; +import { UpdateDetectorRules } from './UpdateRules'; + +describe(' spec', () => { + it('renders the component', () => { + const view = render(); + expect(view).toMatchSnapshot(); + }); +}); diff --git a/public/pages/Detectors/components/UpdateRules/__snapshots__/UpdateDetectorRules.test.tsx.snap b/public/pages/Detectors/components/UpdateRules/__snapshots__/UpdateDetectorRules.test.tsx.snap new file mode 100644 index 000000000..41c355761 --- /dev/null +++ b/public/pages/Detectors/components/UpdateRules/__snapshots__/UpdateDetectorRules.test.tsx.snap @@ -0,0 +1,762 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` spec renders the component 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+

+ Edit detector rules +

+
+
+
+
+
+
+
+ +
+ + EuiIconMock + +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + +
+
+ + +
+ +
+
+
+
+ + + Rule name + + + + + + Rule severity + + + + + + Log type + + + + + + Source + + + + + + Description + + +
+
+ + No items found + +
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ , + "container":
+
+

+ Edit detector rules +

+
+
+
+
+
+
+
+ +
+ + EuiIconMock + +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + +
+
+ + +
+ +
+
+
+
+ + + Rule name + + + + + + Rule severity + + + + + + Log type + + + + + + Source + + + + + + Description + + +
+
+ + No items found + +
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/test/mocks/httpClientMock.ts b/test/mocks/httpClientMock.ts index 1d4ce8f6e..de189380c 100644 --- a/test/mocks/httpClientMock.ts +++ b/test/mocks/httpClientMock.ts @@ -2,7 +2,6 @@ * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ - import { HttpSetup } from 'opensearch-dashboards/public'; const httpClientMock = jest.fn() as any; diff --git a/test/setup.jest.ts b/test/setup.jest.ts index 6697e8525..964772b81 100644 --- a/test/setup.jest.ts +++ b/test/setup.jest.ts @@ -88,6 +88,21 @@ jest.mock('react', () => { }; }, }, + ruleService: { + fetchRules: () => { + return Promise.resolve([mockDetectorHit]); + }, + getRules: () => { + return { + ok: true, + response: { + hits: { + hits: [mockDetectorHit], + }, + }, + }; + }, + }, }), }; }); diff --git a/tsconfig.json b/tsconfig.json index 3115915e9..2bd480b10 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,6 @@ "skipLibCheck": true, "esModuleInterop": true, "outDir": "./target", - "types": ["cypress", "node", "cypress-real-events"] + "types": ["cypress", "node", "cypress-real-events", "jest"] } } From 36b6390287367ed60a2af61ba7f5809ba168e06d Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Thu, 26 Jan 2023 08:43:24 +0100 Subject: [PATCH 07/48] detector unit tests Signed-off-by: Jovan Cvetkovic --- .../UpdateDetectorBasicDetails.mock.ts | 12 + .../UpdateDetectorBasicDetails.test.tsx | 17 + .../UpdateDetectorBasicDetails.test.tsx.snap | 1006 +++++++++++++++++ 3 files changed, 1035 insertions(+) create mode 100644 public/models/Detectors/components/UpdateDetectorBasicDetails/UpdateDetectorBasicDetails.mock.ts create mode 100644 public/pages/Detectors/components/UpdateBasicDetails/UpdateDetectorBasicDetails.test.tsx create mode 100644 public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap diff --git a/public/models/Detectors/components/UpdateDetectorBasicDetails/UpdateDetectorBasicDetails.mock.ts b/public/models/Detectors/components/UpdateDetectorBasicDetails/UpdateDetectorBasicDetails.mock.ts new file mode 100644 index 000000000..140cf6a8e --- /dev/null +++ b/public/models/Detectors/components/UpdateDetectorBasicDetails/UpdateDetectorBasicDetails.mock.ts @@ -0,0 +1,12 @@ +import { mockDetectorHit, notificationsStart } from '../../../Interfaces.mock'; + +export default { + notifications: notificationsStart, + detectorHit: mockDetectorHit, + location: { + pathname: '/edit-detector-details/detectorHitId', + }, + history: { + replace: jest.fn(), + }, +}; diff --git a/public/pages/Detectors/components/UpdateBasicDetails/UpdateDetectorBasicDetails.test.tsx b/public/pages/Detectors/components/UpdateBasicDetails/UpdateDetectorBasicDetails.test.tsx new file mode 100644 index 000000000..0c0c47e12 --- /dev/null +++ b/public/pages/Detectors/components/UpdateBasicDetails/UpdateDetectorBasicDetails.test.tsx @@ -0,0 +1,17 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import props from '../../../../models/Detectors/components/UpdateDetectorBasicDetails/UpdateDetectorBasicDetails.mock'; +import { expect } from '@jest/globals'; +import { UpdateDetectorBasicDetails } from './UpdateBasicDetails'; + +describe(' spec', () => { + it('renders the component', () => { + const view = render(); + expect(view).toMatchSnapshot(); + }); +}); diff --git a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap new file mode 100644 index 000000000..b0a7d6f0f --- /dev/null +++ b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap @@ -0,0 +1,1006 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` spec renders the component 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +
+
+

+ Edit detector details +

+
+
+
+
+

+ Detector details +

+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ , + "container":
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+

+ If a detection rule matches +

+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+

+ Alert and notify +

+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap b/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap index 1680d1723..e443fc161 100644 --- a/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap +++ b/public/pages/Detectors/components/AlertTriggerView/__snapshots__/AlertTriggerView.test.tsx.snap @@ -37,7 +37,7 @@ Object { class="euiText euiText--medium" >

- Alert on alertName + Alert on alert_name

@@ -87,7 +87,7 @@ Object { data-test-subj="text-details-group-content-trigger name" id="some_html_id" > - alertName + alert_name
@@ -139,7 +139,7 @@ Object { data-test-subj="text-details-group-content-log type" id="some_html_id" > - detectorType1 + detector_type_1
@@ -224,7 +224,7 @@ Object { data-test-subj="text-details-group-content-rule severities" id="some_html_id" > - low + severity_level_low
@@ -401,7 +401,7 @@ Object { class="euiText euiText--medium" >

- Alert on alertName + Alert on alert_name

@@ -451,7 +451,7 @@ Object { data-test-subj="text-details-group-content-trigger name" id="some_html_id" > - alertName + alert_name
@@ -503,7 +503,7 @@ Object { data-test-subj="text-details-group-content-log type" id="some_html_id" > - detectorType1 + detector_type_1
@@ -588,7 +588,7 @@ Object { data-test-subj="text-details-group-content-rule severities" id="some_html_id" > - low + severity_level_low
diff --git a/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap b/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap index ef450303a..16f8cdb89 100644 --- a/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap +++ b/public/pages/Detectors/components/DetectorBasicDetailsView/__snapshots__/DetectorBasicDetailsView.test.tsx.snap @@ -96,7 +96,7 @@ Object { data-test-subj="text-details-group-content-detector name" id="some_html_id" > - detectorName + detector_name
@@ -135,7 +135,7 @@ Object { data-test-subj="text-details-group-content-log type" id="some_html_id" > - .windows + detector_type
@@ -442,7 +442,7 @@ Object { data-test-subj="text-details-group-content-detector name" id="some_html_id" > - detectorName + detector_name
@@ -481,7 +481,7 @@ Object { data-test-subj="text-details-group-content-log type" id="some_html_id" > - .windows + detector_type
diff --git a/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap b/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap index 498abb4b2..df921a703 100644 --- a/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap +++ b/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap @@ -4,15 +4,28 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -38,111 +63,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -315,380 +340,487 @@ exports[` spec renders the component 1`] = ` ruleItems={Array []} showRuleDetails={[Function]} > - -
- +
+ -
- + +
-
- -
- - - -
+ + +
- - - - -
- -
-
+ EuiIconMock + + +
-
-
-
-
-
-
- +
+
+ + + +
+ + +
+ -
- +
+ spec renders the component 1`] = ` }, ], "type": "field_value_selection", - }, + } + } + index={0} + onChange={[Function]} + query={ + Query { + "ast": _AST { + "_clauses": Array [], + "_indexedClauses": Object { + "field": Object {}, + "group": Array [], + "is": Object {}, + "term": Array [], + }, + }, + "syntax": Object { + "parse": [Function], + "print": [Function], + "printClause": [Function], + }, + "text": "", + } + } + > + + Rule Type + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="field_value_selection_0" + isOpen={false} + ownFocus={true} + panelClassName="euiFilterGroup__popoverPanel" + panelPaddingSize="none" + > +
+
+ + + + + +
+
+
+
+ spec renders the component 1`] = ` }, ], "type": "field_value_selection", - }, - Object { - "field": "source", - "multiSelect": "or", - "name": "Source", - "options": Array [ - Object { - "value": "Sigma", - }, - Object { - "value": "Custom", + } + } + index={1} + onChange={[Function]} + query={ + Query { + "ast": _AST { + "_clauses": Array [], + "_indexedClauses": Object { + "field": Object {}, + "group": Array [], + "is": Object {}, + "term": Array [], }, - ], - "type": "field_value_selection", - }, - ] - } - onChange={[Function]} - query={ - Query { - "ast": _AST { - "_clauses": Array [], - "_indexedClauses": Object { - "field": Object {}, - "group": Array [], - "is": Object {}, - "term": Array [], }, - }, - "syntax": Object { - "parse": [Function], - "print": [Function], - "printClause": [Function], - }, - "text": "", + "syntax": Object { + "parse": [Function], + "print": [Function], + "printClause": [Function], + }, + "text": "", + } } - } - > - -
+ + Rule Severity + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="field_value_selection_1" + isOpen={false} + ownFocus={true} + panelClassName="euiFilterGroup__popoverPanel" + panelPaddingSize="none" > - - + + - Rule Type - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="field_value_selection_0" - isOpen={false} - ownFocus={true} - panelClassName="euiFilterGroup__popoverPanel" - panelPaddingSize="none" - > -
-
- - - - - -
-
-
-
- + + + + + +
+
+ + + + + Source + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="field_value_selection_2" + isOpen={false} + ownFocus={true} + panelClassName="euiFilterGroup__popoverPanel" + panelPaddingSize="none" + > +
- + + - Rule Severity - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="field_value_selection_1" - isOpen={false} - ownFocus={true} - panelClassName="euiFilterGroup__popoverPanel" - panelPaddingSize="none" - > -
-
- - - - - -
-
-
- - + + + + + +
+
+ + +
+ + +
+ +
+ + + +
+ + +
+
+ +
+ +
+ +
+ + +
+ +
- Source - + + } closePopover={[Function]} display="inlineBlock" hasArrow={true} - id="field_value_selection_2" isOpen={false} ownFocus={true} - panelClassName="euiFilterGroup__popoverPanel" panelPaddingSize="none" >
- - - - - + + + +
- -
- - +
+ +
+
- +
- - - -
- - -
+ -
- -
+ + - -
+ + + + + + - -
- - -
- -
- - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="none" - > -
+ -
- - - -
-
-
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - + - - + Rule Severity + + + + + + + + + + - - + Log type + + + + + + + + + + - - - - - - - - + + + + + + + + + - - - - - -
+ + + + + + + + - -
- - - - - - + - - + - - - - + + - - Description - - - - - -
+ - - + -
- No items found + Description -
-
-
-
-
- + + + + + + + + + + + + + + + +
+ + No items found + +
+ +
+ +
+ +
+ +
+
- +
- +
diff --git a/public/pages/Detectors/components/FieldMappingsView/__snapshots__/FieldMappingsView.test.tsx.snap b/public/pages/Detectors/components/FieldMappingsView/__snapshots__/FieldMappingsView.test.tsx.snap index 9c356e54c..199178e02 100644 --- a/public/pages/Detectors/components/FieldMappingsView/__snapshots__/FieldMappingsView.test.tsx.snap +++ b/public/pages/Detectors/components/FieldMappingsView/__snapshots__/FieldMappingsView.test.tsx.snap @@ -138,7 +138,7 @@ Object { - ruleFieldName + index_field_name
@@ -156,7 +156,7 @@ Object { - indexFieldName + index_field_name
@@ -178,7 +178,7 @@ Object { - ruleFieldName + index_field_name
@@ -196,7 +196,7 @@ Object { - indexFieldName + index_field_name
@@ -343,7 +343,7 @@ Object { - ruleFieldName + index_field_name
@@ -361,7 +361,7 @@ Object { - indexFieldName + index_field_name
@@ -383,7 +383,7 @@ Object { - ruleFieldName + index_field_name
@@ -401,7 +401,7 @@ Object { - indexFieldName + index_field_name
diff --git a/public/pages/Detectors/components/UpdateAlertConditions/__snapshots__/UpdateAlertConditions.test.tsx.snap b/public/pages/Detectors/components/UpdateAlertConditions/__snapshots__/UpdateAlertConditions.test.tsx.snap index 2e2d75f10..9820cf431 100644 --- a/public/pages/Detectors/components/UpdateAlertConditions/__snapshots__/UpdateAlertConditions.test.tsx.snap +++ b/public/pages/Detectors/components/UpdateAlertConditions/__snapshots__/UpdateAlertConditions.test.tsx.snap @@ -130,7 +130,7 @@ Object { placeholder="Enter a name for the alert condition." required="" type="text" - value="alertName" + value="alert_name" />
@@ -276,8 +276,8 @@ Object { > - low + severity_level_low
@@ -831,7 +831,7 @@ Object { required="" rows="6" > - messageSource + some_source
@@ -988,7 +988,7 @@ Object { placeholder="Enter a name for the alert condition." required="" type="text" - value="alertName" + value="alert_name" />
@@ -1134,8 +1134,8 @@ Object { > - low + severity_level_low
@@ -1689,7 +1689,7 @@ Object { required="" rows="6" > - messageSource + some_source
@@ -1924,7 +1924,7 @@ Object { placeholder="Enter a name for the alert condition." required="" type="text" - value="alertName" + value="alert_name" />
@@ -2070,8 +2070,8 @@ Object { > - low + severity_level_low
@@ -2625,7 +2625,7 @@ Object { required="" rows="6" > - messageSource + some_source
@@ -2782,7 +2782,7 @@ Object { placeholder="Enter a name for the alert condition." required="" type="text" - value="alertName" + value="alert_name" />
@@ -2928,8 +2928,8 @@ Object { > - low + severity_level_low
@@ -3483,7 +3483,7 @@ Object { required="" rows="6" > - messageSource + some_source
diff --git a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap index ee1ace4ef..12f7d3dd3 100644 --- a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap +++ b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap @@ -4,19 +4,32 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], "last_update_time": 1, - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -43,111 +68,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -157,29 +182,46 @@ exports[` spec renders the component 1`] = ` } history={ Object { + "listen": [MockFunction], + "location": Object { + "pathname": "", + }, "replace": [MockFunction] { "calls": Array [ Array [ Object { - "pathname": "/edit-detector-details/detectorHitId", + "pathname": "/edit-detector-details/detector_id_1", "state": Object { "detectorHit": Object { - "_id": "detectorHitId", + "_id": "detector_id_1", "_index": ".windows", "_source": Object { - "_id": "detectorHitId", + "_id": "detector_id_1", "_index": ".windows", "_source": Object { - "createdBy": "testUser", - "detector_type": ".windows", + "createdBy": "someone", + "detector_type": "detector_type", "enabled": true, "enabled_time": 1, + "id": "detector_id_1", "inputs": Array [ Object { "detector_input": Object { "custom_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], "description": "detectorDescription", @@ -188,14 +230,26 @@ exports[` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], "last_update_time": 1, - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -206,126 +260,139 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], "type": "detector", }, - "createdBy": "testUser", - "detector_type": ".windows", + "createdBy": "someone", + "detector_type": "detector_type", "enabled": true, "enabled_time": 1, + "id": "detector_id_1", "inputs": Array [ Object { "detector_input": Object { "custom_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], "description": "detectorDescription", @@ -334,14 +401,26 @@ exports[` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], "last_update_time": 1, - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -352,111 +431,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -478,7 +557,7 @@ exports[` spec renders the component 1`] = ` } location={ Object { - "pathname": "/edit-detector-details/detectorHitId", + "pathname": "/edit-detector-details/detector_id_1", } } notifications={ @@ -508,7 +587,7 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` placeholder="Enter a name for the detector." readOnly={false} required={true} - value="detectorName" + value="detector_name" > spec renders the component 1`] = ` readOnly={false} required={true} type="text" - value="detectorName" + value="detector_name" /> @@ -1234,16 +1313,29 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], "last_update_time": 1, - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -1270,111 +1374,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -1596,16 +1700,29 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], "last_update_time": 1, - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -1632,111 +1761,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -1748,9 +1877,11 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` className="euiFormRow__labelWrapper" >
@@ -945,7 +1020,7 @@ exports[` spec renders the component 1`] = ` onBlur={[Function]} onFocus={[Function]} > - detectorType1 + detector_type_1
@@ -1146,7 +1221,7 @@ exports[` spec renders the component 1`] = ` onBlur={[Function]} onFocus={[Function]} > - low + severity_level_low
@@ -1463,70 +1538,83 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], } } detector={ Object { - "createdBy": "testUser", - "detector_type": ".windows", + "createdBy": "someone", + "detector_type": "detector_type", "enabled": true, + "id": "detector_id_1", "inputs": Array [ Object { "detector_input": Object { "custom_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], "description": "detectorDescription", @@ -1535,13 +1623,25 @@ exports[` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -1552,136 +1652,149 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], "type": "detector", } } - key="triggerId_1" + key="trigger_id_1" notificationChannels={Array []} orderPosition={1} rules={ Object { - "detectorHitId": Object { - "_id": "detectorHitId", + "detector_id_1": Object { + "_id": "detector_id_1", "_index": ".windows", "_source": Object { - "createdBy": "testUser", - "detector_type": ".windows", + "createdBy": "someone", + "detector_type": "detector_type", "enabled": true, "enabled_time": 1, + "id": "detector_id_1", "inputs": Array [ Object { "detector_input": Object { "custom_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], "description": "detectorDescription", @@ -1690,14 +1803,26 @@ exports[` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], "last_update_time": 1, - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -1708,111 +1833,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -1842,7 +1967,7 @@ exports[` spec renders the component 1`] = ` size="m" >

- Alert on alertName + Alert on alert_name

} @@ -1887,7 +2012,7 @@ exports[` spec renders the component 1`] = ` className="euiText euiText--medium" >

- Alert on alertName + Alert on alert_name

@@ -1984,7 +2109,7 @@ exports[` spec renders the component 1`] = ` onBlur={[Function]} onFocus={[Function]} > - alertName + alert_name
@@ -2103,7 +2228,7 @@ exports[` spec renders the component 1`] = ` onBlur={[Function]} onFocus={[Function]} > - detectorType1 + detector_type_1
@@ -2304,7 +2429,7 @@ exports[` spec renders the component 1`] = ` onBlur={[Function]} onFocus={[Function]} > - low + severity_level_low
diff --git a/public/pages/Detectors/containers/Detector/__snapshots__/DetectorDetails.test.tsx.snap b/public/pages/Detectors/containers/Detector/__snapshots__/DetectorDetails.test.tsx.snap index 04d1f5f44..7dc908b8c 100644 --- a/public/pages/Detectors/containers/Detector/__snapshots__/DetectorDetails.test.tsx.snap +++ b/public/pages/Detectors/containers/Detector/__snapshots__/DetectorDetails.test.tsx.snap @@ -4,19 +4,32 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], "last_update_time": 1, - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -43,111 +68,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -156,18 +181,28 @@ exports[` spec renders the component 1`] = ` } } detectorService={ - Object { + DetectorService { + "createDetector": [Function], + "deleteDetector": [Function], + "getDetector": [Function], "getDetectors": [Function], + "osDriver": [MockFunction], + "searchDetectors": [Function], + "updateDetector": [Function], } } history={ Object { + "listen": [MockFunction], + "location": Object { + "pathname": "", + }, "replace": [MockFunction], } } location={ Object { - "pathname": "/detector-details/detectorHitId", + "pathname": "/detector-details/detector_id_1", } } notifications={ @@ -178,3934 +213,4102 @@ exports[` spec renders the component 1`] = ` } } > - +
- +
- +
-
- -
- -

- detectorName -

-
-
-
- + +
+ + +
+
-
-
- -
- - EuiIconMock - -
-
- -
- Active -
-
+ EuiIconMock + +
+ + +
+ Active
-
+
-
+
- +
-
+
-
- + +
+
+ +
+
-
- -
- - - - - -
-
- + + + + + +
+ + +
+ -
- - - - + View Findings + + + + + + +
+ + +
+ + Actions -
-
-
- + + - Actions - - } - closePopover={[Function]} - data-test-subj="detectorsActionsPopover" - display="inlineBlock" - hasArrow={true} - id="detectorsActionsPopover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" - > -
-
- - - - - -
-
-
+ EuiIconMock + + + Actions + + + + + + +
-
+
-
+
-
+
-
- +
+ + +
+ + +
+ -
- - -
- - - - - - - + + + + - -
-
- + + + -
- - + + Alert triggers + + + +
+ + +
+ + + + + Edit + , + ] } + title="Detector details" > - - - Edit - , - ] +
-
- +
- -
+

- -

- Detector details -

-
-

-
- + +
+
+ +
+
-
- -
- - - - - -
-
+ Edit + + + + + +
-
+
- +
-
- -
-
+ +
+ + +
+
+
+
+ + +
- -
- - -
- +
+ + Detector name + } + labelType="label" >
- - Detector name - - } - labelType="label" +
-
-
- - - -
-
- -
- detectorName +
+ + +
+
+ +
+ detector_name
-
- + +
- - +
+ + +
+ + Log type + + } + labelType="label" >
- - Log type - - } - labelType="label" +
-
-
- - - -
-
- -
- .windows +
+ + +
+
+ +
+ detector_type
-
- + +
- - +
+ + +
+ + Data source + } + labelType="label" >
- - Data source - - } - labelType="label" +
-
-
- - - -
-
- -
- .windows +
+ + +
+
+ +
+ .windows
-
- + +
- +
- - +
+ + +
+ + +
+
- - -
- + Description + } + labelType="label" >
- - Description - - } - labelType="label" +
-
-
- - - -
-
- -
- detectorDescription +
+ + +
+
+ +
+ detectorDescription
-
- + +
- - +
+
+ +
+ + Detector schedule + } + labelType="label" >
- - Detector schedule - - } - labelType="label" +
-
-
- - - -
-
- -
- Every 1 minute +
+ + +
+
+ +
+ Every 1 minute
-
- + +
- - +
+ + +
+ + Created at + } + labelType="label" >
- - Created at - - } - labelType="label" +
-
-
- - - -
-
- -
- 2023-01-25T10:05 +
+ + +
+
+ +
+ 2023-01-25T10:05
-
- + +
- - +
+ + +
+ + Last updated time + } + labelType="label" >
- - Last updated time - - } - labelType="label" +
-
-
- - - -
-
- -
- 2023-01-25T10:05 +
+ + +
+
+ +
+ 2023-01-25T10:05
-
- + +
- +
- - -
- +
-
- - - - -
- - + +
+ +
+
+ + + + +
+ + + + Edit + , + ] + } + title="Active rules (2)" + > + - - Edit - , - ] +
-
- +
- -
+

- -

- Active rules (2) -

-
-

-
- + +
+
+ +
+
-
- -
- - - - - -
-
+ Edit + + + + + +
-
+
- +
-
- -
-
-
+
+ + +
+
+
+ + - - -
- + -
- + +
+ +
- -
-
- - + + + - -
-
- - -
- - - - - -
-
-
-
-
-
-
+ EuiIconMock + + + +
+ +
-
- + + +
+ + +
+ + +
-
- - -
- - - Rule Type - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="field_value_selection_0" - isOpen={false} - ownFocus={true} - panelClassName="euiFilterGroup__popoverPanel" - panelPaddingSize="none" - > -
-
- - - - - -
-
-
-
- - - Rule Severity - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="field_value_selection_1" - isOpen={false} - ownFocus={true} - panelClassName="euiFilterGroup__popoverPanel" - panelPaddingSize="none" - > -
-
- - - - - -
-
-
-
- - - Source - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="field_value_selection_2" - isOpen={false} - ownFocus={true} - panelClassName="euiFilterGroup__popoverPanel" - panelPaddingSize="none" - > -
-
- - - - - -
-
-
-
-
-
-
-
- -
- - - -
- - -
-
- -
- -
- -
- - -
- -
- - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="none" - > -
-
- - - -
-
-
-
-
-
-
-
- -
- - - - - - - - - - - - - + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="field_value_selection_0" + isOpen={false} + ownFocus={true} + panelClassName="euiFilterGroup__popoverPanel" + panelPaddingSize="none" + > +
+
+ -
- - + + + + + + + + Rule Severity + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="field_value_selection_1" + isOpen={false} + ownFocus={true} + panelClassName="euiFilterGroup__popoverPanel" + panelPaddingSize="none" + > +
+
+ -
- - + + + + + + + + Source + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="field_value_selection_2" + isOpen={false} + ownFocus={true} + panelClassName="euiFilterGroup__popoverPanel" + panelPaddingSize="none" + > +
+
+ -
- - + + + + + + + + + + + + + + +
+ + +
+
+ +
+ +
+ +
+ + +
+ +
+ + + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + isOpen={false} + ownFocus={true} + panelPaddingSize="none" + > +
-
+ + + + + + + + + + + + + + + + + + + + + + + + +
- -
- - - - - - - - - + + + EuiIconMock + - Description + + Sorting + - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - -
+ +
+
+ + -
- - No items found - -
-
-
- - - - - + Rule Severity + + + + +
+ +
+ + + + + + + + + + Description + + + + + +
+
+ + No items found + +
+
+
+
- - -
-
- - - - -
- + +
+
+ +
+
+ + + + `; diff --git a/public/pages/Detectors/containers/DetectorDetailsView/__snapshots__/DetectorDetailsView.test.tsx.snap b/public/pages/Detectors/containers/DetectorDetailsView/__snapshots__/DetectorDetailsView.test.tsx.snap index 8e09db1e7..bce001130 100644 --- a/public/pages/Detectors/containers/DetectorDetailsView/__snapshots__/DetectorDetailsView.test.tsx.snap +++ b/public/pages/Detectors/containers/DetectorDetailsView/__snapshots__/DetectorDetailsView.test.tsx.snap @@ -4,15 +4,28 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -38,111 +63,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -165,15 +190,28 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -199,111 +249,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -572,7 +622,7 @@ exports[` spec renders the component 1`] = ` onBlur={[Function]} onFocus={[Function]} > - detectorName + detector_name
@@ -666,7 +716,7 @@ exports[` spec renders the component 1`] = ` onBlur={[Function]} onFocus={[Function]} > - .windows + detector_type
@@ -1181,15 +1231,28 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -1215,111 +1290,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -1496,380 +1571,487 @@ exports[` spec renders the component 1`] = ` ruleItems={Array []} showRuleDetails={[Function]} > - -
- +
+ -
- + +
-
- -
- - - -
+ + +
- - - - -
- -
-
+ EuiIconMock + + +
-
-
-
-
-
-
- +
+
+ + + +
+ + +
+ -
- +
+ spec renders the component 1`] = ` }, ], "type": "field_value_selection", - }, + } + } + index={0} + onChange={[Function]} + query={ + Query { + "ast": _AST { + "_clauses": Array [], + "_indexedClauses": Object { + "field": Object {}, + "group": Array [], + "is": Object {}, + "term": Array [], + }, + }, + "syntax": Object { + "parse": [Function], + "print": [Function], + "printClause": [Function], + }, + "text": "", + } + } + > + + Rule Type + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="field_value_selection_0" + isOpen={false} + ownFocus={true} + panelClassName="euiFilterGroup__popoverPanel" + panelPaddingSize="none" + > +
+
+ + + + + +
+
+
+
+ spec renders the component 1`] = ` }, ], "type": "field_value_selection", - }, - Object { - "field": "source", - "multiSelect": "or", - "name": "Source", - "options": Array [ - Object { - "value": "Sigma", - }, - Object { - "value": "Custom", + } + } + index={1} + onChange={[Function]} + query={ + Query { + "ast": _AST { + "_clauses": Array [], + "_indexedClauses": Object { + "field": Object {}, + "group": Array [], + "is": Object {}, + "term": Array [], }, - ], - "type": "field_value_selection", - }, - ] - } - onChange={[Function]} - query={ - Query { - "ast": _AST { - "_clauses": Array [], - "_indexedClauses": Object { - "field": Object {}, - "group": Array [], - "is": Object {}, - "term": Array [], }, - }, - "syntax": Object { - "parse": [Function], - "print": [Function], - "printClause": [Function], - }, - "text": "", + "syntax": Object { + "parse": [Function], + "print": [Function], + "printClause": [Function], + }, + "text": "", + } } - } - > - -
+ + Rule Severity + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="field_value_selection_1" + isOpen={false} + ownFocus={true} + panelClassName="euiFilterGroup__popoverPanel" + panelPaddingSize="none" > - - + + - Rule Type - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="field_value_selection_0" - isOpen={false} - ownFocus={true} - panelClassName="euiFilterGroup__popoverPanel" - panelPaddingSize="none" - > -
-
- - - - - -
-
-
-
- + + + + + +
+
+ + + + + Source + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="field_value_selection_2" + isOpen={false} + ownFocus={true} + panelClassName="euiFilterGroup__popoverPanel" + panelPaddingSize="none" + > +
- + + - Rule Severity - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="field_value_selection_1" - isOpen={false} - ownFocus={true} - panelClassName="euiFilterGroup__popoverPanel" - panelPaddingSize="none" - > -
-
- - - - - -
-
-
- - + + + + + +
+
+ + +
+ + +
+ +
+ + + +
+ + +
+
+ +
+ +
+ +
+ + +
+ +
- Source - + + } closePopover={[Function]} display="inlineBlock" hasArrow={true} - id="field_value_selection_2" isOpen={false} ownFocus={true} - panelClassName="euiFilterGroup__popoverPanel" panelPaddingSize="none" >
- - - - - + + + +
- -
- - +
+ +
+
- +
- - - -
- - -
+ -
- -
+ + - -
+ + + + + + - -
- - -
- -
- - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="none" - > -
+ -
- - - -
-
-
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - + - - + Rule Severity + + + + + + + + + + - - + Log type + + + + + + + + + + - - - - - - - - + + + + + + + + + - - - - - -
+ + + + + + + + - -
- - - - - - + - - + - - - - + + - - Description - - - - - -
+ - - + -
- No items found + Description -
-
-
-
-
- + + + + + + + + + + + + + + + +
+ + No items found + +
+ +
+ +
+ +
+ +
+
- +
- +
diff --git a/public/pages/Detectors/containers/Detectors/__snapshots__/Detectors.test.tsx.snap b/public/pages/Detectors/containers/Detectors/__snapshots__/Detectors.test.tsx.snap index ff5500738..aeac0caba 100644 --- a/public/pages/Detectors/containers/Detectors/__snapshots__/Detectors.test.tsx.snap +++ b/public/pages/Detectors/containers/Detectors/__snapshots__/Detectors.test.tsx.snap @@ -3,8 +3,14 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` items={ Array [ Object { - "_id": "detectorHitId", + "_id": "detector_id_1", "_index": ".windows", "_source": Object { - "createdBy": "testUser", - "detector_type": ".windows", + "createdBy": "someone", + "detector_type": "detector_type", "enabled": true, "enabled_time": 1, + "id": "detector_id_1", "inputs": Array [ Object { "detector_input": Object { "custom_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], "description": "detectorDescription", @@ -371,14 +390,26 @@ exports[` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], "last_update_time": 1, - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -389,119 +420,119 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], "type": "detector", }, - "detectorName": "detectorName", + "detectorName": "detector_name", "lastUpdatedTime": 1, - "logType": ".windows", + "logType": "detector_type", "rulesCount": 2, "status": "Active", }, @@ -557,7 +588,7 @@ exports[` spec renders the component 1`] = ` "options": Array [ Object { "name": "-", - "value": ".windows", + "value": "detector_type", }, ], "type": "field_value_selection", @@ -628,7 +659,7 @@ exports[` spec renders the component 1`] = ` "options": Array [ Object { "name": "-", - "value": ".windows", + "value": "detector_type", }, ], "type": "field_value_selection", @@ -759,7 +790,7 @@ exports[` spec renders the component 1`] = ` "options": Array [ Object { "name": "-", - "value": ".windows", + "value": "detector_type", }, ], "type": "field_value_selection", @@ -934,7 +965,7 @@ exports[` spec renders the component 1`] = ` "options": Array [ Object { "name": "-", - "value": ".windows", + "value": "detector_type", }, ], "type": "field_value_selection", @@ -1119,19 +1150,32 @@ exports[` spec renders the component 1`] = ` items={ Array [ Object { - "_id": "detectorHitId", + "_id": "detector_id_1", "_index": ".windows", "_source": Object { - "createdBy": "testUser", - "detector_type": ".windows", + "createdBy": "someone", + "detector_type": "detector_type", "enabled": true, "enabled_time": 1, + "id": "detector_id_1", "inputs": Array [ Object { "detector_input": Object { "custom_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], "description": "detectorDescription", @@ -1140,14 +1184,26 @@ exports[` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], "last_update_time": 1, - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -1158,119 +1214,119 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], "type": "detector", }, - "detectorName": "detectorName", + "detectorName": "detector_name", "lastUpdatedTime": 1, - "logType": ".windows", + "logType": "detector_type", "rulesCount": 2, "status": "Active", }, @@ -1907,7 +1963,7 @@ exports[` spec renders the component 1`] = ` className="euiTableRow euiTableRow-isSelectable" > spec renders the component 1`] = ` aria-label="Select this row" checked={false} compressed={false} - data-test-subj="checkboxSelectRow-detectorHitId" + data-test-subj="checkboxSelectRow-detector_id_1" disabled={false} - id="_selection_column_detectorHitId-checkbox" + id="_selection_column_detector_id_1-checkbox" indeterminate={false} onChange={[Function]} title="Select this row" @@ -1938,9 +1994,9 @@ exports[` spec renders the component 1`] = ` aria-label="Select this row" checked={false} className="euiCheckbox__input" - data-test-subj="checkboxSelectRow-detectorHitId" + data-test-subj="checkboxSelectRow-detector_id_1" disabled={false} - id="_selection_column_detectorHitId-checkbox" + id="_selection_column_detector_id_1-checkbox" onChange={[Function]} title="Select this row" type="checkbox" @@ -1956,7 +2012,7 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` onClick={[Function]} type="button" > - detectorName + detector_name
@@ -2001,7 +2057,7 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` spec renders the component 1`] = ` spec renders the component 1`] = ` spec renders the component 1`] = ` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -38,111 +63,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -151,10 +176,11 @@ exports[` spec renders the component 1`] = ` } fieldMappings={Array []} filedMappingService={ - Object { + FieldMappingService { "createMappings": [Function], "getMappings": [Function], "getMappingsView": [Function], + "httpClient": [MockFunction], } } loading={false} @@ -264,15 +290,28 @@ exports[` spec renders the component 1`] = ` spec renders the component 1`] = ` ], "pre_packaged_rules": Array [ Object { - "id": "detectorRuleId", + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, }, ], }, }, ], - "name": "detectorName", + "name": "detector_name", "schedule": Object { "period": Object { "interval": 1, @@ -298,111 +349,111 @@ exports[` spec renders the component 1`] = ` Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_0", + "id": "trigger_id_0", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, Object { "actions": Array [ Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, Object { - "destination_id": "destinationId", - "id": "someId", + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", "message_template": Object { - "lang": "en-US", - "source": "messageSource", + "lang": "some_lang", + "source": "some_source", }, - "name": "triggerName", + "name": "some_name", "subject_template": Object { - "lang": "en-US", - "source": "sourceTemplate", + "lang": "some_lang", + "source": "some_source", }, "throttle": Object { - "unit": "throttleUnit", + "unit": "minutes", "value": 1, }, - "throttle_enabled": false, + "throttle_enabled": true, }, ], - "id": "triggerId_1", + "id": "trigger_id_1", "ids": Array [ - "ruleId1", + "rule_id_1", ], - "name": "alertName", + "name": "alert_name", "sev_levels": Array [ - "low", + "severity_level_low", ], "severity": "1", "tags": Array [ "any.tag", ], "types": Array [ - "detectorType1", + "detector_type_1", ], }, ], @@ -411,10 +462,11 @@ exports[` spec renders the component 1`] = ` } fieldMappings={Array []} filedMappingService={ - Object { + FieldMappingService { "createMappings": [Function], "getMappings": [Function], "getMappingsView": [Function], + "httpClient": [MockFunction], } } indexFields={Array []} diff --git a/test/mocks/Alerts/AlertItem.mock.ts b/test/mocks/Alerts/AlertItem.mock.ts new file mode 100644 index 000000000..5982e1b2e --- /dev/null +++ b/test/mocks/Alerts/AlertItem.mock.ts @@ -0,0 +1,16 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export default { + id: 'some id', + start_time: 'some start time', + trigger_name: 'some trigger name', + detector_id: 'some detector id', + state: 'some state', + severity: 'critical', + finding_ids: ['some finding id'], + last_notification_time: 'some notification time', + acknowledged_time: 'some acknowledged time', +}; diff --git a/test/mocks/Alerts/Alerts.mock.ts b/test/mocks/Alerts/Alerts.mock.ts new file mode 100644 index 000000000..ab7b403b3 --- /dev/null +++ b/test/mocks/Alerts/Alerts.mock.ts @@ -0,0 +1,23 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import services from '../services'; +import notificationsStartMock from '../services/notifications/NotificationsStart.mock'; +const { alertService, detectorService, findingsService, ruleService, openSearchService } = services; + +export default { + alertService: alertService, + detectorService: detectorService, + findingService: findingsService, + ruleService: ruleService, + opensearchService: openSearchService, + notifications: notificationsStartMock, + match: jest.fn(), + dateTimeFilter: { + startTime: 'now-24h', + endTime: 'now', + }, + setDateTimeFilter: jest.fn(), +}; diff --git a/test/mocks/Alerts/PeriodSchedule.mock.ts b/test/mocks/Alerts/PeriodSchedule.mock.ts new file mode 100644 index 000000000..42e07f5f8 --- /dev/null +++ b/test/mocks/Alerts/PeriodSchedule.mock.ts @@ -0,0 +1,11 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export default { + period: { + interval: 1, + unit: 'minute', + }, +}; diff --git a/test/mocks/Alerts/components/AlertFlyout/AlertFlyout.mock.ts b/test/mocks/Alerts/components/AlertFlyout/AlertFlyout.mock.ts new file mode 100644 index 000000000..4687f0f99 --- /dev/null +++ b/test/mocks/Alerts/components/AlertFlyout/AlertFlyout.mock.ts @@ -0,0 +1,21 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import notificationsStartMock from '../../../services/notifications/NotificationsStart.mock'; +import services from '../../../services'; +import alertItemMock from '../../AlertItem.mock'; +import detectorMock from '../../../Detectors/containers/Detectors/Detector.mock'; +const { openSearchService, findingsService, ruleService } = services; + +export default { + alertItem: alertItemMock, + detector: detectorMock, + findingsService, + ruleService, + notifications: notificationsStartMock, + opensearchService: openSearchService, + onClose: jest.fn(), + onAcknowledge: jest.fn(), +}; diff --git a/test/mocks/Alerts/index.ts b/test/mocks/Alerts/index.ts new file mode 100644 index 000000000..4cf5f9929 --- /dev/null +++ b/test/mocks/Alerts/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import periodSchedule from './PeriodSchedule.mock'; +import alertItem from './AlertItem.mock'; +import alertFlyout from './components/AlertFlyout/AlertFlyout.mock'; +import alerts from './Alerts.mock'; + +export default { + alerts, + periodSchedule, + alertItem, + alertFlyout, +}; diff --git a/test/mocks/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertCondition.mock.ts b/test/mocks/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertCondition.mock.ts new file mode 100644 index 000000000..1ca76040a --- /dev/null +++ b/test/mocks/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertCondition.mock.ts @@ -0,0 +1,26 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { TriggerAction } from '../../../../../../../types'; +import triggerActionMock from './TriggerAction.mock'; +import { times } from 'lodash'; + +const triggerAction: TriggerAction = triggerActionMock; + +export default { + name: 'alert_name', + id: 'trigger_id', + types: ['detector_type_1'], + sev_levels: ['severity_level_low'], + tags: ['any.tag'], + ids: ['rule_id_1'], + actions: times(2, (index) => { + return { + ...triggerAction, + id: `${triggerAction.id}_${index}`, + }; + }), + severity: '1', +}; diff --git a/test/mocks/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.mock.ts b/test/mocks/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.mock.ts index f76ed764c..9168e7948 100644 --- a/test/mocks/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.mock.ts +++ b/test/mocks/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.mock.ts @@ -4,69 +4,25 @@ */ import { AlertCondition } from '../../../../../../../models/interfaces'; -import { - NotificationChannelOption, - NotificationChannelTypeOptions, -} from '../../../../../../../public/pages/CreateDetector/components/ConfigureAlerts/models/interfaces'; -import { CreateDetectorRulesOptions } from '../../../../../../../public/models/types'; -import { RuleOptions, RulesPage } from '../../../../../../../public/models/interfaces'; -import { mockTriggerAction } from '../../../../../Detectors/containers/AlertTriggersView/AlertTriggersView.mock'; -import { mockDetector } from '../../../../../Detectors/containers/Detectors/Detectors.mock'; +import { NotificationChannelTypeOptions } from '../../../../../../../public/pages/CreateDetector/components/ConfigureAlerts/models/interfaces'; +import { RuleOptions } from '../../../../../../../public/models/interfaces'; +import ruleOptionsMock from '../../../../../Rules/RuleOptions.mock'; +import alertConditionMock from './AlertCondition.mock'; +import notificationChannelTypeOptionsMock from '../../../../../services/notifications/NotificationChannelTypeOptions.mock'; +import detectorMock from '../../../../../Detectors/containers/Detectors/Detector.mock'; -export const mockAlertCondition: AlertCondition = { - // Trigger fields - name: 'alertCondition', - id: 'alertConditionId', - - // Detector types - types: ['windows', 'dns'], - - // Trigger fields based on Rules - sev_levels: ['low', 'high', 'critical'], - tags: ['mock.tag'], - ids: ['ruleID1', 'ruleID2'], - - // Alert related fields - actions: [mockTriggerAction], - severity: 'low', -}; - -export const mockNotificationChannelOption: NotificationChannelOption = { - label: 'notificationChanelOptionLabel', - value: 'notificationChanelOptionValue', - type: 'notificationChanelOptionType', - description: 'notificationChanelOptionDescription', -}; - -export const mockNotificationChannelTypeOptions: NotificationChannelTypeOptions = { - label: 'notificationChannelLabel', - options: [mockNotificationChannelOption], -}; - -export const mockRulesPage: RulesPage = { - index: 1, -}; - -export const mockRuleOptions: RuleOptions = { - name: 'RuleOptionsName', - id: 'RuleOptionsID', - severity: 'low', - tags: ['mock.tag'], -}; - -export const mockCreateDetectorRulesOptions: CreateDetectorRulesOptions = { - page: mockRulesPage, - rulesOptions: [mockRuleOptions], -}; +const alertCondition: AlertCondition = alertConditionMock; +const notificationChannelTypeOptions: NotificationChannelTypeOptions = notificationChannelTypeOptionsMock; +const rulesOptions: RuleOptions = ruleOptionsMock; export default { - alertCondition: mockAlertCondition, - allNotificationChannels: [mockNotificationChannelTypeOptions], - rulesOptions: [mockRuleOptions], - detector: mockDetector, - indexNum: 1, + alertCondition, + allNotificationChannels: [notificationChannelTypeOptions], + rulesOptions: [rulesOptions], + detector: detectorMock, + indexNum: 0, isEdit: false, - hasNotificationPlugin: false, + hasNotificationPlugin: true, loadingNotifications: false, onAlertTriggerChanged: jest.fn(), refreshNotificationChannels: jest.fn(), diff --git a/test/mocks/CreateDetector/components/ConfigureAlerts/components/AlertCondition/TriggerAction.mock.ts b/test/mocks/CreateDetector/components/ConfigureAlerts/components/AlertCondition/TriggerAction.mock.ts new file mode 100644 index 000000000..9b41ca627 --- /dev/null +++ b/test/mocks/CreateDetector/components/ConfigureAlerts/components/AlertCondition/TriggerAction.mock.ts @@ -0,0 +1,23 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export default { + id: 'trigger_id_1', + destination_id: 'some_destination_id_1', + subject_template: { + source: 'some_source', + lang: 'some_lang', + }, + name: 'some_name', + throttle_enabled: true, + message_template: { + source: 'some_source', + lang: 'some_lang', + }, + throttle: { + unit: 'minutes', + value: 1, + }, +}; diff --git a/test/mocks/CreateDetector/index.ts b/test/mocks/CreateDetector/index.ts new file mode 100644 index 000000000..3753b8c2f --- /dev/null +++ b/test/mocks/CreateDetector/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import alertCondition from './components/ConfigureAlerts/components/AlertCondition/AlertCondition.mock'; +import alertConditionPanel from './components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.mock'; +import triggerAction from './components/ConfigureAlerts/components/AlertCondition/TriggerAction.mock'; + +export default { + alertCondition, + alertConditionPanel, + triggerAction, +}; diff --git a/test/mocks/Detectors/components/AlertTriggerView/AlertTriggerView.mock.ts b/test/mocks/Detectors/components/AlertTriggerView/AlertTriggerView.mock.ts index 8d2935a30..95b33ff27 100644 --- a/test/mocks/Detectors/components/AlertTriggerView/AlertTriggerView.mock.ts +++ b/test/mocks/Detectors/components/AlertTriggerView/AlertTriggerView.mock.ts @@ -3,28 +3,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { RuleInfo, RuleSource } from '../../../../../server/models/interfaces'; -import { mockAlertCondition } from '../../containers/AlertTriggersView/AlertTriggersView.mock'; -import { mockDetector } from '../../containers/Detectors/Detectors.mock'; - -const mockRuleSource: RuleSource = { - rule: 'ruleName', - last_update_time: '12/12/2022', - queries: [{ value: '.windows' }], -}; - -const mockRuleInfo: RuleInfo = { - _id: 'ruleId', - _index: '.windows', - _primary_term: 1, - _source: mockRuleSource, - _version: 1, -}; +import alertConditionMock from '../../../CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertCondition.mock'; +import detectorMock from '../../containers/Detectors/Detector.mock'; +import ruleInfoMock from '../../../Rules/RuleInfo.mock'; export default { - alertTrigger: mockAlertCondition, + alertTrigger: alertConditionMock, orderPosition: 1, - detector: mockDetector, + detector: detectorMock, notificationChannels: [], - rules: { rileId: mockRuleInfo }, + rules: { rileId: ruleInfoMock }, }; diff --git a/test/mocks/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.mock.ts b/test/mocks/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.mock.ts index 184b87501..9f734a10b 100644 --- a/test/mocks/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.mock.ts +++ b/test/mocks/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.mock.ts @@ -1,7 +1,12 @@ -import { mockDetector } from '../../containers/Detectors/Detectors.mock'; +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import detectorMock from '../../containers/Detectors/Detector.mock'; export default { - detector: mockDetector, + detector: detectorMock, rulesCanFold: true, enabled_time: 1, last_update_time: 1, diff --git a/test/mocks/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts b/test/mocks/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts index f112e6859..f824a597e 100644 --- a/test/mocks/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts +++ b/test/mocks/Detectors/components/DetectorRulesView/DetectorRulesView.mock.ts @@ -1,9 +1,14 @@ -import { mockDetector } from '../../containers/Detectors/Detectors.mock'; -import { mockNotificationsStart } from '../../../browserServicesMock'; +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import detectorMock from '../../containers/Detectors/Detector.mock'; +import notificationsStartMock from '../../../services/notifications/NotificationsStart.mock'; export default { - detector: mockDetector, + detector: detectorMock, rulesCanFold: false, onEditClicked: jest.fn(), - notifications: mockNotificationsStart, + notifications: notificationsStartMock, }; diff --git a/test/mocks/Detectors/components/FieldMappingsView/FieldMapping.mock.ts b/test/mocks/Detectors/components/FieldMappingsView/FieldMapping.mock.ts new file mode 100644 index 000000000..51d06d5fc --- /dev/null +++ b/test/mocks/Detectors/components/FieldMappingsView/FieldMapping.mock.ts @@ -0,0 +1,9 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export default { + indexFieldName: 'index_field_name', + ruleFieldName: 'index_field_name', +}; diff --git a/test/mocks/Detectors/components/FieldMappingsView/FieldMappingsView.mock.ts b/test/mocks/Detectors/components/FieldMappingsView/FieldMappingsView.mock.ts index 21bf35008..8ad9d06c8 100644 --- a/test/mocks/Detectors/components/FieldMappingsView/FieldMappingsView.mock.ts +++ b/test/mocks/Detectors/components/FieldMappingsView/FieldMappingsView.mock.ts @@ -1,15 +1,10 @@ -import { FieldMapping } from '../../../../../models/interfaces'; -import { mockDetector } from '../../containers/Detectors/Detectors.mock'; -import { mockNotificationsStart } from '../../../browserServicesMock'; - -const mockFieldMapping: FieldMapping = { - indexFieldName: 'indexFieldName', - ruleFieldName: 'ruleFieldName', -}; +import notificationsStartMock from '../../../services/notifications/NotificationsStart.mock'; +import detectorMock from '../../containers/Detectors/Detector.mock'; +import fieldMappingMock from './FieldMapping.mock'; export default { - detector: mockDetector, - existingMappings: [mockFieldMapping, mockFieldMapping], + detector: detectorMock, + existingMappings: [fieldMappingMock, fieldMappingMock], editFieldMappings: jest.fn(), - notifications: mockNotificationsStart, + notifications: notificationsStartMock, }; diff --git a/test/mocks/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts b/test/mocks/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts index 2405c2da3..c96e54a02 100644 --- a/test/mocks/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts +++ b/test/mocks/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts @@ -3,49 +3,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { - DetectorsService, - NotificationsService, - OpenSearchService, - RuleService, -} from '../../../../../public/services'; -import { mockDetectorHit } from '../../containers/Detectors/Detectors.mock'; -import notificationsService, { mockNotificationsStart } from '../../../browserServicesMock'; - -// const mockNotificationsService: NotificationsService = { -// getChannels: () => { -// return { -// ok: true, -// response: { -// channel_list: [], -// }, -// }; -// }, -// }; - -const mockRuleService: RuleService = { - getRules: () => { - return { - ok: true, - response: { - hits: { - hits: [], - }, - }, - }; - }, -}; +import services from '../../../services'; +import detectorHitMock from '../../containers/Detectors/DetectorHit.mock'; +import notificationsStartMock from '../../../services/notifications/NotificationsStart.mock'; +const { notificationsService, detectorService, openSearchService, ruleService } = services; export default { - detectorHit: mockDetectorHit, - detectorService: DetectorsService, - opensearchService: OpenSearchService, - ruleService: mockRuleService, + detectorHit: detectorHitMock, + detectorService: detectorService, + opensearchService: openSearchService, + ruleService: ruleService, notificationsService: notificationsService, - notifications: mockNotificationsStart, + notifications: notificationsStartMock, location: { state: { - detectorHit: mockDetectorHit, + detectorHit: detectorHitMock, }, }, }; diff --git a/test/mocks/Detectors/components/UpdateDetectorBasicDetails/UpdateDetectorBasicDetails.mock.ts b/test/mocks/Detectors/components/UpdateDetectorBasicDetails/UpdateDetectorBasicDetails.mock.ts index 0df83da63..906d65c98 100644 --- a/test/mocks/Detectors/components/UpdateDetectorBasicDetails/UpdateDetectorBasicDetails.mock.ts +++ b/test/mocks/Detectors/components/UpdateDetectorBasicDetails/UpdateDetectorBasicDetails.mock.ts @@ -1,12 +1,17 @@ -import { mockDetectorHit } from '../../containers/Detectors/Detectors.mock'; -import { mockNotificationsStart } from '../../../browserServicesMock'; -import { mockHistory } from '../../../index'; +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import notificationsStartMock from '../../../services/notifications/NotificationsStart.mock'; +import detectorHitMock from '../../containers/Detectors/DetectorHit.mock'; +import browserHistoryMock from '../../../services/browserHistory.mock'; export default { - notifications: mockNotificationsStart, - detectorHit: mockDetectorHit, + notifications: notificationsStartMock, + detectorHit: detectorHitMock, location: { - pathname: '/edit-detector-details/detectorHitId', + pathname: '/edit-detector-details/detector_id_1', }, - history: mockHistory, + history: browserHistoryMock, }; diff --git a/test/mocks/Detectors/components/UpdateDetectorRules/UpdateDetectorRules.mock.ts b/test/mocks/Detectors/components/UpdateDetectorRules/UpdateDetectorRules.mock.ts index 9935763f7..e9679feb0 100644 --- a/test/mocks/Detectors/components/UpdateDetectorRules/UpdateDetectorRules.mock.ts +++ b/test/mocks/Detectors/components/UpdateDetectorRules/UpdateDetectorRules.mock.ts @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { mockDetectorHit } from '../../containers/Detectors/Detectors.mock'; -import { mockNotificationsStart } from '../../../browserServicesMock'; +import notificationsStartMock from '../../../services/notifications/NotificationsStart.mock'; +import detectorHitMock from '../../containers/Detectors/DetectorHit.mock'; export default { - notifications: mockNotificationsStart, - detectorHit: mockDetectorHit, + notifications: notificationsStartMock, + detectorHit: detectorHitMock, location: { pathname: '', }, diff --git a/test/mocks/Detectors/components/UpdateFieldMappings/UpdateFieldMappings.mock.ts b/test/mocks/Detectors/components/UpdateFieldMappings/UpdateFieldMappings.mock.ts index 05c24e3aa..53b56e19b 100644 --- a/test/mocks/Detectors/components/UpdateFieldMappings/UpdateFieldMappings.mock.ts +++ b/test/mocks/Detectors/components/UpdateFieldMappings/UpdateFieldMappings.mock.ts @@ -1,46 +1,20 @@ -import FieldMappingService from '../../../../../public/services/FieldMappingService'; -import { mockDetectorHit, mockDetectorService } from '../../containers/Detectors/Detectors.mock'; -import { mockNotificationsStart } from '../../../browserServicesMock'; -import { mockHistory } from '../../../index'; +import detectorHitMock from '../../containers/Detectors/DetectorHit.mock'; +import services from '../../../services'; +import notificationsStartMock from '../../../services/notifications/NotificationsStart.mock'; +import browserHistoryMock from '../../../services/browserHistory.mock'; -export const mockFieldMappingService: FieldMappingService = { - createMappings: () => { - return Promise.resolve({ - ok: true, - }); - }, - getMappingsView: () => { - return { - ok: true, - response: { - properties: {}, - }, - }; - }, - getMappings: () => { - return { - ok: true, - response: { - '.windows': { - mappings: { - properties: {}, - }, - }, - }, - }; - }, -}; +const { detectorService, fieldMappingService } = services; export default { - detectorHit: mockDetectorHit, - detectorService: mockDetectorService, - notifications: mockNotificationsStart, - filedMappingService: mockFieldMappingService, + detectorHit: detectorHitMock, + detectorService: detectorService, + notifications: notificationsStartMock, + filedMappingService: fieldMappingService, location: { state: { - detectorHit: mockDetectorHit, + detectorHit: detectorHitMock, }, - pathname: '/edit-field-mappings/detectorHitId', + pathname: '/edit-field-mappings/detector_id_1', }, - history: mockHistory, + history: browserHistoryMock, }; diff --git a/test/mocks/Detectors/containers/AlertTriggersView/AlertTriggersView.mock.ts b/test/mocks/Detectors/containers/AlertTriggersView/AlertTriggersView.mock.ts index f20ad8604..63dc2ab94 100644 --- a/test/mocks/Detectors/containers/AlertTriggersView/AlertTriggersView.mock.ts +++ b/test/mocks/Detectors/containers/AlertTriggersView/AlertTriggersView.mock.ts @@ -1,47 +1,12 @@ -import { AlertCondition, TriggerAction } from '../../../../../models/interfaces'; -import { mockDetector } from '../Detectors/Detectors.mock'; -import { mockNotificationsStart } from '../../../browserServicesMock'; - -export const mockTriggerAction: TriggerAction = { - id: 'someId', - // Id of notification channel - destination_id: 'destinationId', - subject_template: { - source: 'sourceTemplate', - lang: 'en-US', - }, - name: 'triggerName', - throttle_enabled: false, - message_template: { - source: 'messageSource', - lang: 'en-US', - }, - throttle: { - unit: 'throttleUnit', - value: 1, - }, -}; - -export const mockAlertCondition: AlertCondition = { - // Trigger fields - name: 'alertName', - id: 'triggerId', - - // Detector types - types: ['detectorType1'], - - // Trigger fields based on Rules - sev_levels: ['low'], - tags: ['any.tag'], - ids: ['ruleId1'], - - // Alert related fields - actions: [mockTriggerAction, mockTriggerAction], - severity: '1', -}; +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ +import detector from '../Detectors/Detector.mock'; +import notificationsStartMock from '../../../services/notifications/NotificationsStart.mock'; export default { - detector: mockDetector, + detector: detector, editAlertTriggers: jest.fn(), - notifications: mockNotificationsStart, + notifications: notificationsStartMock, }; diff --git a/test/mocks/Detectors/containers/DetectorDetails/DetectorDetails.mock.ts b/test/mocks/Detectors/containers/DetectorDetails/DetectorDetails.mock.ts index d4dfcd970..3866762b3 100644 --- a/test/mocks/Detectors/containers/DetectorDetails/DetectorDetails.mock.ts +++ b/test/mocks/Detectors/containers/DetectorDetails/DetectorDetails.mock.ts @@ -1,13 +1,21 @@ -import { mockDetectorHit, mockDetectorService } from '../Detectors/Detectors.mock'; -import { mockNotificationsStart } from '../../../browserServicesMock'; -import { mockHistory } from '../../../index'; +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import detectorHitMock from '../Detectors/DetectorHit.mock'; +import services from '../../../services'; +import notificationsStartMock from '../../../services/notifications/NotificationsStart.mock'; +import browserHistoryMock from '../../../services/browserHistory.mock'; + +const { detectorService } = services; export default { - detectorHit: mockDetectorHit, - detectorService: mockDetectorService, - notifications: mockNotificationsStart, + detectorHit: detectorHitMock, + detectorService: detectorService, + notifications: notificationsStartMock, location: { - pathname: '/detector-details/detectorHitId', + pathname: '/detector-details/detector_id_1', }, - history: mockHistory, + history: browserHistoryMock, }; diff --git a/test/mocks/Detectors/containers/DetectorDetailsView/DetectorDetailsView.mock.ts b/test/mocks/Detectors/containers/DetectorDetailsView/DetectorDetailsView.mock.ts index bd0c3c5b1..492f9f1fd 100644 --- a/test/mocks/Detectors/containers/DetectorDetailsView/DetectorDetailsView.mock.ts +++ b/test/mocks/Detectors/containers/DetectorDetailsView/DetectorDetailsView.mock.ts @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { mockDetector } from '../Detectors/Detectors.mock'; -import { mockNotificationsStart } from '../../../browserServicesMock'; +import notificationsStartMock from '../../../services/notifications/NotificationsStart.mock'; +import detectorMock from '../Detectors/Detector.mock'; export default { - detector: mockDetector, + detector: detectorMock, enabled_time: 1, last_update_time: 1, rulesCanFold: false, - notifications: mockNotificationsStart, + notifications: notificationsStartMock, editBasicDetails: jest.fn(), editDetectorRules: jest.fn(), }; diff --git a/test/mocks/Detectors/containers/Detectors/Detector.mock.ts b/test/mocks/Detectors/containers/Detectors/Detector.mock.ts new file mode 100644 index 000000000..7d37e528c --- /dev/null +++ b/test/mocks/Detectors/containers/Detectors/Detector.mock.ts @@ -0,0 +1,30 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { AlertCondition, PeriodSchedule } from '../../../../../models/interfaces'; +import detectorInputMock from './DetectorInput.mock'; +import periodScheduleMock from '../../../Alerts/PeriodSchedule.mock'; +import alertConditionMock from '../../../CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertCondition.mock'; +import { times } from 'lodash'; + +const periodSchedule: PeriodSchedule = periodScheduleMock; +const alertCondition: AlertCondition = alertConditionMock; + +export default { + id: 'detector_id_1', + type: 'detector', + detector_type: 'detector_type', + name: 'detector_name', + enabled: true, + createdBy: 'someone', + schedule: periodSchedule, + inputs: [detectorInputMock], + triggers: times(2, (index) => { + return { + ...alertCondition, + id: `${alertCondition.id}_${index}`, + }; + }), +}; diff --git a/test/mocks/Detectors/containers/Detectors/DetectorHit.mock.ts b/test/mocks/Detectors/containers/Detectors/DetectorHit.mock.ts new file mode 100644 index 000000000..107d94591 --- /dev/null +++ b/test/mocks/Detectors/containers/Detectors/DetectorHit.mock.ts @@ -0,0 +1,12 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import detectorResponseMock from './DetectorResponse.mock'; + +export default { + _index: '.windows', + _source: detectorResponseMock, + _id: 'detector_id_1', +}; diff --git a/test/mocks/Detectors/containers/Detectors/DetectorInput.mock.ts b/test/mocks/Detectors/containers/Detectors/DetectorInput.mock.ts new file mode 100644 index 000000000..71a53c392 --- /dev/null +++ b/test/mocks/Detectors/containers/Detectors/DetectorInput.mock.ts @@ -0,0 +1,15 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import ruleInfo from '../../../Rules/RuleInfo.mock'; + +export default { + detector_input: { + description: 'detectorDescription', + indices: ['.windows'], + pre_packaged_rules: [ruleInfo], + custom_rules: [ruleInfo], + }, +}; diff --git a/test/mocks/Detectors/containers/Detectors/DetectorResponse.mock.ts b/test/mocks/Detectors/containers/Detectors/DetectorResponse.mock.ts new file mode 100644 index 000000000..b2bcc9e1b --- /dev/null +++ b/test/mocks/Detectors/containers/Detectors/DetectorResponse.mock.ts @@ -0,0 +1,12 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import detector from './Detector.mock'; + +export default { + last_update_time: 1, + enabled_time: 1, + ...detector, +}; diff --git a/test/mocks/Detectors/containers/Detectors/Detectors.mock.ts b/test/mocks/Detectors/containers/Detectors/Detectors.mock.ts index 0f3e34252..776011bdd 100644 --- a/test/mocks/Detectors/containers/Detectors/Detectors.mock.ts +++ b/test/mocks/Detectors/containers/Detectors/Detectors.mock.ts @@ -3,80 +3,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { - Detector, - DetectorInput, - DetectorRuleInfo, - PeriodSchedule, -} from '../../../../../models/interfaces'; -import { DetectorHit, DetectorResponse } from '../../../../../server/models/interfaces'; -import { DetectorsService } from '../../../../../public/services'; -import { mockAlertCondition } from '../AlertTriggersView/AlertTriggersView.mock'; -import _ from 'lodash'; -import { mockNotificationsStart } from '../../../browserServicesMock'; - -export const mockPeriodSchedule: PeriodSchedule = { - period: { - interval: 1, - unit: 'minute', - }, -}; - -export const mockDetectorRuleInfo: DetectorRuleInfo = { - id: 'detectorRuleId', -}; - -export const mockDetectorInput: DetectorInput = { - detector_input: { - description: 'detectorDescription', - indices: ['.windows'], - pre_packaged_rules: [mockDetectorRuleInfo], - custom_rules: [mockDetectorRuleInfo], - }, -}; - -export const mockDetector: Detector = { - type: 'detector', - detector_type: '.windows', - name: 'detectorName', - enabled: true, - createdBy: 'testUser', - schedule: mockPeriodSchedule, - inputs: [mockDetectorInput], - triggers: _.times(2, (index) => { - return { - ...mockAlertCondition, - id: `triggerId_${index}`, - }; - }), -}; - -export const mockDetectorResponse: DetectorResponse = { - last_update_time: 1, - enabled_time: 1, - ...mockDetector, -}; - -export const mockDetectorHit: DetectorHit = { - _index: '.windows', - _source: mockDetectorResponse, - _id: 'detectorHitId', -}; - -export const mockDetectorService: DetectorsService = { - getDetectors: () => { - return { - ok: true, - response: { - hits: { - hits: [mockDetectorHit], - }, - }, - }; - }, -}; +import services from '../../../services'; +import notifications from '../../../services/notifications'; +const { NotificationsStart } = notifications; +const { detectorService } = services; export default { - detectorService: mockDetectorService, - notifications: mockNotificationsStart, + detectorService: detectorService, + notifications: NotificationsStart, }; diff --git a/test/mocks/Detectors/containers/EditFieldMappings/EditFieldMappings.mock.ts b/test/mocks/Detectors/containers/EditFieldMappings/EditFieldMappings.mock.ts index 37971127c..eb9346ce6 100644 --- a/test/mocks/Detectors/containers/EditFieldMappings/EditFieldMappings.mock.ts +++ b/test/mocks/Detectors/containers/EditFieldMappings/EditFieldMappings.mock.ts @@ -2,13 +2,13 @@ * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ - -import { mockFieldMappingService } from '../../components/UpdateFieldMappings/UpdateFieldMappings.mock'; -import { mockDetector } from '../Detectors/Detectors.mock'; +import detector from '../Detectors/Detector.mock'; +import services from '../../../services'; +const { fieldMappingService } = services; export default { - detector: mockDetector, - filedMappingService: mockFieldMappingService, + detector: detector, + filedMappingService: fieldMappingService, fieldMappings: [], loading: false, replaceFieldMappings: jest.fn(), diff --git a/test/mocks/Detectors/index.ts b/test/mocks/Detectors/index.ts new file mode 100644 index 000000000..ce3d6ea31 --- /dev/null +++ b/test/mocks/Detectors/index.ts @@ -0,0 +1,46 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import detector from './containers/Detectors/Detector.mock'; +import detectors from './containers/Detectors/Detectors.mock'; +import detectorInput from './containers/Detectors/DetectorInput.mock'; +import detectorHit from './containers/Detectors/DetectorHit.mock'; +import detectorResponse from './containers/Detectors/DetectorResponse.mock'; +import ruleInfo from '../Rules/RuleInfo.mock'; +import detectorDetailsView from './containers/DetectorDetailsView/DetectorDetailsView.mock'; +import editFieldMappings from './containers/EditFieldMappings/EditFieldMappings.mock'; +import detectorDetails from './containers/DetectorDetails/DetectorDetails.mock'; +import alertTriggersView from './containers/AlertTriggersView/AlertTriggersView.mock'; +import alertTriggerView from './components/AlertTriggerView/AlertTriggerView.mock'; +import detectorBasicDetailsView from './components/DetectorBasicDetailsView/DetectorBasicDetailsView.mock'; +import detectorRulesView from './components/DetectorRulesView/DetectorRulesView.mock'; +import fieldMapping from './components/FieldMappingsView/FieldMapping.mock'; +import fieldMappingsView from './components/FieldMappingsView/FieldMappingsView.mock'; +import updateAlertConditions from './components/UpdateAlertConditions/UpdateAlertConditions.mock'; +import updateDetectorBasicDetails from './components/UpdateDetectorBasicDetails/UpdateDetectorBasicDetails.mock'; +import updateDetectorRules from './components/UpdateDetectorRules/UpdateDetectorRules.mock'; +import updateFieldMappings from './components/UpdateFieldMappings/UpdateFieldMappings.mock'; + +export default { + detector, + detectors, + detectorInput, + detectorHit, + detectorResponse, + ruleInfo, + detectorDetailsView, + editFieldMappings, + detectorDetails, + alertTriggersView, + alertTriggerView, + detectorBasicDetailsView, + detectorRulesView, + fieldMapping, + fieldMappingsView, + updateAlertConditions, + updateDetectorBasicDetails, + updateDetectorRules, + updateFieldMappings, +}; diff --git a/test/mocks/Rules/RuleInfo.mock.ts b/test/mocks/Rules/RuleInfo.mock.ts new file mode 100644 index 000000000..005a2a027 --- /dev/null +++ b/test/mocks/Rules/RuleInfo.mock.ts @@ -0,0 +1,14 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import ruleSourceMock from './RuleSource.mock'; + +export default { + _id: 'rule_id_1', + _index: '.windows', + _primary_term: 1, + _source: ruleSourceMock, + _version: 1, +}; diff --git a/test/mocks/Rules/RuleOptions.mock.ts b/test/mocks/Rules/RuleOptions.mock.ts new file mode 100644 index 000000000..3052f0774 --- /dev/null +++ b/test/mocks/Rules/RuleOptions.mock.ts @@ -0,0 +1,11 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export default { + name: 'rule_options_name', + id: 'rule_options_id_1', + severity: 'severity_low', + tags: ['mock.tag'], +}; diff --git a/test/mocks/Rules/RulePage.mock.ts b/test/mocks/Rules/RulePage.mock.ts new file mode 100644 index 000000000..c401ad756 --- /dev/null +++ b/test/mocks/Rules/RulePage.mock.ts @@ -0,0 +1,8 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export default { + index: 1, +}; diff --git a/test/mocks/Rules/RuleSource.mock.ts b/test/mocks/Rules/RuleSource.mock.ts new file mode 100644 index 000000000..0ed7ee51a --- /dev/null +++ b/test/mocks/Rules/RuleSource.mock.ts @@ -0,0 +1,10 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export default { + rule: 'rule_name', + last_update_time: '12/12/2022', + queries: [{ value: '.windows' }], +}; diff --git a/test/mocks/Rules/index.ts b/test/mocks/Rules/index.ts new file mode 100644 index 000000000..b9c0565e2 --- /dev/null +++ b/test/mocks/Rules/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import RuleOptions from './RuleOptions.mock'; +import RulePage from './RulePage.mock'; + +export default { + RuleOptions, + RulePage, +}; diff --git a/test/mocks/browserServicesMock.ts b/test/mocks/browserServicesMock.ts deleted file mode 100644 index 7c50046c6..000000000 --- a/test/mocks/browserServicesMock.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { - AlertsService, - DetectorsService, - FieldMappingService, - FindingsService, - NotificationsService, -} from '../../public/services'; -import httpClientMock from './httpClientMock'; - -const alertsService = new AlertsService(httpClientMock); -const detectorService = new DetectorsService(httpClientMock); -const fieldMappingService = new FieldMappingService(httpClientMock); -const findingsService = new FindingsService(httpClientMock); -const notificationsService = new NotificationsService(httpClientMock); -const ruleService = new RuleService(httpClientMock); - -export const mockNotificationsStart = { - toasts: { - addDanger: jest.fn(), - }, -}; - -export default { - alertsService, - detectorService, - fieldMappingService, - findingsService, - ruleService, - notificationsService, -}; diff --git a/test/mocks/context.mock.ts b/test/mocks/context.mock.ts new file mode 100644 index 000000000..662913e49 --- /dev/null +++ b/test/mocks/context.mock.ts @@ -0,0 +1,14 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; + +const context = { + chrome: { + setBreadcrumbs: jest.fn(), + }, +}; + +export default React.createContext(context); diff --git a/test/mocks/index.ts b/test/mocks/index.ts index 982fe9974..cce326dea 100644 --- a/test/mocks/index.ts +++ b/test/mocks/index.ts @@ -3,11 +3,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import browserServicesMock from './browserServicesMock'; -import httpClientMock from './httpClientMock'; +import services from './services'; +import rules from './Rules'; +import detectors from './Detectors'; +import createDetector from './CreateDetector'; +import alerts from './Alerts'; +import history from './services/browserHistory.mock'; -export const mockHistory = { - replace: jest.fn(), -}; - -export { browserServicesMock, httpClientMock }; +export default { services, rules, detectors, createDetector, alerts, history }; diff --git a/test/mocks/services/alertService.mock.ts b/test/mocks/services/alertService.mock.ts new file mode 100644 index 000000000..2179dbdb9 --- /dev/null +++ b/test/mocks/services/alertService.mock.ts @@ -0,0 +1,15 @@ +import httpClientMock from './httpClient.mock'; +import { AlertService } from '../../../server/services'; + +const alertService = new AlertService(httpClientMock); +Object.assign(alertService, { + getAlerts: () => + Promise.resolve({ + ok: true, + response: { + alerts: [], + }, + }), +}); + +export default alertService; diff --git a/test/mocks/services/browserHistory.mock.ts b/test/mocks/services/browserHistory.mock.ts new file mode 100644 index 000000000..440e22326 --- /dev/null +++ b/test/mocks/services/browserHistory.mock.ts @@ -0,0 +1,12 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export default { + replace: jest.fn(), + listen: jest.fn(), + location: { + pathname: '', + }, +}; diff --git a/test/mocks/services/detectorService.mock.ts b/test/mocks/services/detectorService.mock.ts new file mode 100644 index 000000000..4f3083988 --- /dev/null +++ b/test/mocks/services/detectorService.mock.ts @@ -0,0 +1,18 @@ +import httpClientMock from './httpClient.mock'; +import { DetectorService } from '../../../server/services'; +import detectorHitMock from '../Detectors/containers/Detectors/DetectorHit.mock'; + +const detectorService = new DetectorService(httpClientMock); +Object.assign(detectorService, { + getDetectors: () => + Promise.resolve({ + ok: true, + response: { + hits: { + hits: [detectorHitMock], + }, + }, + }), +}); + +export default detectorService; diff --git a/test/mocks/services/fieldMappingService.mock.ts b/test/mocks/services/fieldMappingService.mock.ts new file mode 100644 index 000000000..b2dcef3a7 --- /dev/null +++ b/test/mocks/services/fieldMappingService.mock.ts @@ -0,0 +1,27 @@ +import FieldMappingService from '../../../public/services/FieldMappingService'; +import httpClientMock from './httpClient.mock'; + +const fieldMappingService = new FieldMappingService(httpClientMock); +Object.assign(fieldMappingService, { + getMappingsView: () => + Promise.resolve({ + ok: true, + response: { + unmapped_field_aliases: [], + properties: {}, + }, + }), + getMappings: () => + Promise.resolve({ + ok: true, + response: { + '.windows': { + mappings: { + properties: {}, + }, + }, + }, + }), +}); + +export default fieldMappingService; diff --git a/test/mocks/services/findingsService.mock.ts b/test/mocks/services/findingsService.mock.ts new file mode 100644 index 000000000..9c37352bb --- /dev/null +++ b/test/mocks/services/findingsService.mock.ts @@ -0,0 +1,15 @@ +import httpClientMock from './httpClient.mock'; +import { FindingsService } from '../../../public/services'; + +const findingsService = new FindingsService(httpClientMock); +Object.assign(findingsService, { + getFindings: () => + Promise.resolve({ + ok: true, + response: { + findings: [], + }, + }), +}); + +export default findingsService; diff --git a/test/mocks/httpClientMock.ts b/test/mocks/services/httpClient.mock.ts similarity index 100% rename from test/mocks/httpClientMock.ts rename to test/mocks/services/httpClient.mock.ts diff --git a/test/mocks/services/index.ts b/test/mocks/services/index.ts new file mode 100644 index 000000000..5212db35a --- /dev/null +++ b/test/mocks/services/index.ts @@ -0,0 +1,30 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { OpenSearchService } from '../../../public/services'; +import httpClientMock from './httpClient.mock'; +import notificationsMock from './notifications/index'; +import savedObjectsClientMock from './savedObjectsClient.mock'; + +import fieldMappingService from './fieldMappingService.mock'; +import detectorService from './detectorService.mock'; +import notificationsService from './notifications/notificationsService.mock'; +import ruleService from './ruleService.mock'; +import findingsService from './findingsService.mock'; +import alertService from './alertService.mock'; + +const openSearchService = new OpenSearchService(httpClientMock, savedObjectsClientMock); + +export default { + alertService, + detectorService, + fieldMappingService, + findingsService, + ruleService, + notificationsService, + httpClientMock, + notificationsMock, + openSearchService, +}; diff --git a/test/mocks/services/notifications/NotificationChannelOption.mock.ts b/test/mocks/services/notifications/NotificationChannelOption.mock.ts new file mode 100644 index 000000000..56e644b2d --- /dev/null +++ b/test/mocks/services/notifications/NotificationChannelOption.mock.ts @@ -0,0 +1,11 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export default { + label: 'some_label', + value: 'some_value', + type: 'some_type', + description: 'some_description', +}; diff --git a/test/mocks/services/notifications/NotificationChannelTypeOptions.mock.ts b/test/mocks/services/notifications/NotificationChannelTypeOptions.mock.ts new file mode 100644 index 000000000..0dcc0b867 --- /dev/null +++ b/test/mocks/services/notifications/NotificationChannelTypeOptions.mock.ts @@ -0,0 +1,14 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { NotificationChannelOption } from '../../../../public/pages/CreateDetector/components/ConfigureAlerts/models/interfaces'; +import notificationChannelOptionMock from './NotificationChannelOption.mock'; + +const notificationChannelOption: NotificationChannelOption = notificationChannelOptionMock; + +export default { + label: 'some_label', + options: [notificationChannelOption], +}; diff --git a/test/mocks/services/notifications/NotificationsStart.mock.ts b/test/mocks/services/notifications/NotificationsStart.mock.ts new file mode 100644 index 000000000..93f411eff --- /dev/null +++ b/test/mocks/services/notifications/NotificationsStart.mock.ts @@ -0,0 +1,10 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export default { + toasts: { + addDanger: jest.fn(), + }, +}; diff --git a/test/mocks/services/notifications/index.ts b/test/mocks/services/notifications/index.ts new file mode 100644 index 000000000..de5a537bb --- /dev/null +++ b/test/mocks/services/notifications/index.ts @@ -0,0 +1,9 @@ +import NotificationChannelOption from './NotificationChannelOption.mock'; +import NotificationTypeOptions from './NotificationChannelTypeOptions.mock'; +import NotificationsStart from './NotificationsStart.mock'; + +export default { + NotificationChannelOption, + NotificationTypeOptions, + NotificationsStart, +}; diff --git a/test/mocks/services/notifications/notificationsService.mock.ts b/test/mocks/services/notifications/notificationsService.mock.ts new file mode 100644 index 000000000..2dfedbba1 --- /dev/null +++ b/test/mocks/services/notifications/notificationsService.mock.ts @@ -0,0 +1,15 @@ +import { NotificationsService } from '../../../../public/services'; +import httpClientMock from '../httpClient.mock'; + +const notificationsService = new NotificationsService(httpClientMock); +Object.assign(notificationsService, { + getChannels: () => + Promise.resolve({ + ok: true, + response: { + channel_list: [], + }, + }), +}); + +export default notificationsService; diff --git a/test/mocks/services/ruleService.mock.ts b/test/mocks/services/ruleService.mock.ts new file mode 100644 index 000000000..6c79c936a --- /dev/null +++ b/test/mocks/services/ruleService.mock.ts @@ -0,0 +1,17 @@ +import httpClientMock from './httpClient.mock'; +import { RuleService } from '../../../public/services'; + +const ruleService = new RuleService(httpClientMock); +Object.assign(ruleService, { + getRules: () => + Promise.resolve({ + ok: true, + response: { + hits: { + hits: [], + }, + }, + }), +}); + +export default ruleService; diff --git a/test/mocks/services/savedObjectsClient.mock.ts b/test/mocks/services/savedObjectsClient.mock.ts new file mode 100644 index 000000000..0e638ffb5 --- /dev/null +++ b/test/mocks/services/savedObjectsClient.mock.ts @@ -0,0 +1,16 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { SavedObjectsClientContract } from 'opensearch-dashboards/public'; + +const savedObjectsClientMock = jest.fn() as any; + +savedObjectsClientMock.delete = jest.fn(); +savedObjectsClientMock.get = jest.fn(); +savedObjectsClientMock.head = jest.fn(); +savedObjectsClientMock.post = jest.fn(); +savedObjectsClientMock.put = jest.fn(); + +export default savedObjectsClientMock as SavedObjectsClientContract; diff --git a/test/setup.jest.ts b/test/setup.jest.ts index 1e2e63daa..3ac0e2482 100644 --- a/test/setup.jest.ts +++ b/test/setup.jest.ts @@ -8,7 +8,7 @@ import '@testing-library/jest-dom/extend-expect'; import { configure } from '@testing-library/react'; import Enzyme from 'enzyme'; import Adapter from 'enzyme-adapter-react-16'; -import { mockDetectorHit } from './mocks/Detectors/containers/Detectors/Detectors.mock'; +import detectorHitMock from './mocks/Detectors/containers/Detectors/DetectorHit.mock'; Enzyme.configure({ adapter: new Adapter() }); @@ -92,7 +92,7 @@ const mockUseContext = { ok: true, response: { hits: { - hits: [mockDetectorHit], + hits: [detectorHitMock], }, }, }; @@ -100,14 +100,14 @@ const mockUseContext = { }, ruleService: { fetchRules: () => { - return Promise.resolve([mockDetectorHit]); + return Promise.resolve([detectorHitMock]); }, getRules: () => { return { ok: true, response: { hits: { - hits: [mockDetectorHit], + hits: [detectorHitMock], }, }, }; diff --git a/yarn.lock b/yarn.lock index 522a0742b..9fc09d7c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,7 +22,33 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.5.tgz#86f172690b093373a933223b4745deeb6049e733" integrity sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g== -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": +"@babel/compat-data@^7.20.5": + version "7.20.10" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.10.tgz#9d92fa81b87542fff50e848ed585b4212c1d34ec" + integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg== + +"@babel/core@^7.11.6": + version "7.20.12" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.12.tgz#7930db57443c6714ad216953d1356dac0eb8496d" + integrity sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.7" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-module-transforms" "^7.20.11" + "@babel/helpers" "^7.20.7" + "@babel/parser" "^7.20.7" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.12" + "@babel/types" "^7.20.7" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.2" + semver "^6.3.0" + +"@babel/core@^7.12.3": version "7.20.5" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.5.tgz#45e2114dc6cd4ab167f81daf7820e8fa1250d113" integrity sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ== @@ -52,6 +78,15 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" +"@babel/generator@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" + integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw== + dependencies: + "@babel/types" "^7.20.7" + "@jridgewell/gen-mapping" "^0.3.2" + jsesc "^2.5.1" + "@babel/helper-compilation-targets@^7.20.0": version "7.20.0" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz#6bf5374d424e1b3922822f1d9bdaa43b1a139d0a" @@ -62,6 +97,17 @@ browserslist "^4.21.3" semver "^6.3.0" +"@babel/helper-compilation-targets@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" + integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== + dependencies: + "@babel/compat-data" "^7.20.5" + "@babel/helper-validator-option" "^7.18.6" + browserslist "^4.21.3" + lru-cache "^5.1.1" + semver "^6.3.0" + "@babel/helper-environment-visitor@^7.18.9": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" @@ -89,6 +135,20 @@ dependencies: "@babel/types" "^7.18.6" +"@babel/helper-module-transforms@^7.20.11": + version "7.20.11" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" + integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-validator-identifier" "^7.19.1" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.10" + "@babel/types" "^7.20.7" + "@babel/helper-module-transforms@^7.20.2": version "7.20.2" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz#ac53da669501edd37e658602a21ba14c08748712" @@ -103,7 +163,7 @@ "@babel/traverse" "^7.20.1" "@babel/types" "^7.20.2" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0": version "7.20.2" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== @@ -151,6 +211,15 @@ "@babel/traverse" "^7.20.5" "@babel/types" "^7.20.5" +"@babel/helpers@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.7.tgz#04502ff0feecc9f20ecfaad120a18f011a8e6dce" + integrity sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA== + dependencies: + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" + "@babel/highlight@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" @@ -165,6 +234,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.5.tgz#7f3c7335fe417665d929f34ae5dceae4c04015e8" integrity sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA== +"@babel/parser@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" + integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== + "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -200,6 +274,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-jsx@^7.7.2": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" + integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" @@ -272,6 +353,15 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" +"@babel/template@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" + integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + "@babel/traverse@^7.20.1", "@babel/traverse@^7.20.5", "@babel/traverse@^7.7.2": version "7.20.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.5.tgz#78eb244bea8270fdda1ef9af22a5d5e5b7e57133" @@ -288,6 +378,22 @@ debug "^4.1.0" globals "^11.1.0" +"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.7": + version "7.20.12" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.12.tgz#7f0f787b3a67ca4475adef1f56cb94f6abd4a4b5" + integrity sha512-MsIbFN0u+raeja38qboyF8TIT7K0BFzz/Yd/77ta4MsUsmP2RAnidIlwq7d5HFQrH/OZJecGV6B71C4zAgpoSQ== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.7" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + debug "^4.1.0" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.3.0", "@babel/types@^7.3.3": version "7.20.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.5.tgz#e206ae370b5393d94dfd1d04cd687cace53efa84" @@ -297,6 +403,15 @@ "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" +"@babel/types@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" + integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== + dependencies: + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -307,6 +422,13 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@cypress/listr-verbose-renderer@^0.4.1": version "0.4.1" resolved "https://registry.yarnpkg.com/@cypress/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#a77492f4b11dcc7c446a34b3e28721afd33c642a" @@ -373,163 +495,185 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.1.tgz#260fe7239602fe5130a94f1aa386eff54b014bba" - integrity sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg== +"@jest/console@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.3.1.tgz#3e3f876e4e47616ea3b1464b9fbda981872e9583" + integrity sha512-IRE6GD47KwcqA09RIWrabKdHPiKDGgtAL31xDxbi/RjQMsr+lY+ppxmHwY0dUEV3qvvxZzoe5Hl0RXZJOjQNUg== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.5.1" - jest-util "^27.5.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" slash "^3.0.0" -"@jest/core@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.1.tgz#267ac5f704e09dc52de2922cbf3af9edcd64b626" - integrity sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ== - dependencies: - "@jest/console" "^27.5.1" - "@jest/reporters" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" +"@jest/core@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.3.1.tgz#bff00f413ff0128f4debec1099ba7dcd649774a1" + integrity sha512-0ohVjjRex985w5MmO5L3u5GR1O30DexhBSpuwx2P+9ftyqHdJXnk7IUWiP80oHMvt7ubHCJHxV0a0vlKVuZirw== + dependencies: + "@jest/console" "^29.3.1" + "@jest/reporters" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - emittery "^0.8.1" + ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^27.5.1" - jest-config "^27.5.1" - jest-haste-map "^27.5.1" - jest-message-util "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-resolve-dependencies "^27.5.1" - jest-runner "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" - jest-watcher "^27.5.1" + jest-changed-files "^29.2.0" + jest-config "^29.3.1" + jest-haste-map "^29.3.1" + jest-message-util "^29.3.1" + jest-regex-util "^29.2.0" + jest-resolve "^29.3.1" + jest-resolve-dependencies "^29.3.1" + jest-runner "^29.3.1" + jest-runtime "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" + jest-watcher "^29.3.1" micromatch "^4.0.4" - rimraf "^3.0.0" + pretty-format "^29.3.1" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.1.tgz#d7425820511fe7158abbecc010140c3fd3be9c74" - integrity sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA== +"@jest/environment@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.1.tgz#eb039f726d5fcd14698acd072ac6576d41cfcaa6" + integrity sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag== dependencies: - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/fake-timers" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" - jest-mock "^27.5.1" + jest-mock "^29.3.1" -"@jest/fake-timers@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" - integrity sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ== +"@jest/expect-utils@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.3.1.tgz#531f737039e9b9e27c42449798acb5bba01935b6" + integrity sha512-wlrznINZI5sMjwvUoLVk617ll/UYfGIZNxmbU+Pa7wmkL4vYzhV9R2pwVqUh4NWWuLQWkI8+8mOkxs//prKQ3g== + dependencies: + jest-get-type "^29.2.0" + +"@jest/expect@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.3.1.tgz#456385b62894349c1d196f2d183e3716d4c6a6cd" + integrity sha512-QivM7GlSHSsIAWzgfyP8dgeExPRZ9BIe2LsdPyEhCGkZkoyA+kGsoIzbKAfZCvvRzfZioKwPtCZIt5SaoxYCvg== + dependencies: + expect "^29.3.1" + jest-snapshot "^29.3.1" + +"@jest/fake-timers@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.3.1.tgz#b140625095b60a44de820876d4c14da1aa963f67" + integrity sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A== dependencies: - "@jest/types" "^27.5.1" - "@sinonjs/fake-timers" "^8.0.1" + "@jest/types" "^29.3.1" + "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^27.5.1" - jest-mock "^27.5.1" - jest-util "^27.5.1" + jest-message-util "^29.3.1" + jest-mock "^29.3.1" + jest-util "^29.3.1" -"@jest/globals@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.1.tgz#7ac06ce57ab966566c7963431cef458434601b2b" - integrity sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q== +"@jest/globals@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.3.1.tgz#92be078228e82d629df40c3656d45328f134a0c6" + integrity sha512-cTicd134vOcwO59OPaB6AmdHQMCtWOe+/DitpTZVxWgMJ+YvXL1HNAmPyiGbSHmF/mXVBkvlm8YYtQhyHPnV6Q== dependencies: - "@jest/environment" "^27.5.1" - "@jest/types" "^27.5.1" - expect "^27.5.1" + "@jest/environment" "^29.3.1" + "@jest/expect" "^29.3.1" + "@jest/types" "^29.3.1" + jest-mock "^29.3.1" -"@jest/reporters@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.1.tgz#ceda7be96170b03c923c37987b64015812ffec04" - integrity sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw== +"@jest/reporters@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.3.1.tgz#9a6d78c109608e677c25ddb34f907b90e07b4310" + integrity sha512-GhBu3YFuDrcAYW/UESz1JphEAbvUjaY2vShRZRoRY1mxpCMB3yGSJ4j9n0GxVlEOdCf7qjvUfBCrTUUqhVfbRA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" + "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" - glob "^7.1.2" + glob "^7.1.3" graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" istanbul-lib-instrument "^5.1.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-haste-map "^27.5.1" - jest-resolve "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" + jest-worker "^29.3.1" slash "^3.0.0" - source-map "^0.6.0" string-length "^4.0.1" - terminal-link "^2.0.0" - v8-to-istanbul "^8.1.0" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.1" -"@jest/source-map@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" - integrity sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg== +"@jest/schemas@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a" + integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA== + dependencies: + "@sinclair/typebox" "^0.24.1" + +"@jest/source-map@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.2.0.tgz#ab3420c46d42508dcc3dc1c6deee0b613c235744" + integrity sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ== dependencies: + "@jridgewell/trace-mapping" "^0.3.15" callsites "^3.0.0" graceful-fs "^4.2.9" - source-map "^0.6.0" -"@jest/test-result@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.1.tgz#56a6585fa80f7cdab72b8c5fc2e871d03832f5bb" - integrity sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag== +"@jest/test-result@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.3.1.tgz#92cd5099aa94be947560a24610aa76606de78f50" + integrity sha512-qeLa6qc0ddB0kuOZyZIhfN5q0e2htngokyTWsGriedsDhItisW7SDYZ7ceOe57Ii03sL988/03wAcBh3TChMGw== dependencies: - "@jest/console" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^29.3.1" + "@jest/types" "^29.3.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz#4057e0e9cea4439e544c6353c6affe58d095745b" - integrity sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ== +"@jest/test-sequencer@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.3.1.tgz#fa24b3b050f7a59d48f7ef9e0b782ab65123090d" + integrity sha512-IqYvLbieTv20ArgKoAMyhLHNrVHJfzO6ARZAbQRlY4UGWfdDnLlZEF0BvKOMd77uIiIjSZRwq3Jb3Fa3I8+2UA== dependencies: - "@jest/test-result" "^27.5.1" + "@jest/test-result" "^29.3.1" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-runtime "^27.5.1" + jest-haste-map "^29.3.1" + slash "^3.0.0" -"@jest/transform@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.1.tgz#6c3501dcc00c4c08915f292a600ece5ecfe1f409" - integrity sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw== +"@jest/transform@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.3.1.tgz#1e6bd3da4af50b5c82a539b7b1f3770568d6e36d" + integrity sha512-8wmCFBTVGYqFNLWfcOWoVuMuKYPUBTnTMDkdvFtAYELwDOl9RGwOsvQWGPFxDJ8AWY9xM/8xCXdqmPK3+Q5Lug== dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^27.5.1" + "@babel/core" "^7.11.6" + "@jest/types" "^29.3.1" + "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-regex-util "^27.5.1" - jest-util "^27.5.1" + jest-haste-map "^29.3.1" + jest-regex-util "^29.2.0" + jest-util "^29.3.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" - source-map "^0.6.1" - write-file-atomic "^3.0.0" + write-file-atomic "^4.0.1" "@jest/types@^24.9.0": version "24.9.0" @@ -540,15 +684,16 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" -"@jest/types@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" - integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== +"@jest/types@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.3.1.tgz#7c5a80777cb13e703aeec6788d044150341147e3" + integrity sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA== dependencies: + "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" - "@types/yargs" "^16.0.0" + "@types/yargs" "^17.0.8" chalk "^4.0.0" "@jridgewell/gen-mapping@^0.1.0": @@ -568,7 +713,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@3.1.0": +"@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== @@ -583,7 +728,15 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.9": version "0.3.17" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== @@ -619,6 +772,11 @@ dependencies: any-observable "^0.3.0" +"@sinclair/typebox@^0.24.1": + version "0.24.51" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" + integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== + "@sinonjs/commons@^1.7.0": version "1.8.6" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" @@ -626,10 +784,10 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^8.0.1": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz#3fdc2b6cb58935b21bfb8d1625eb1300484316e7" - integrity sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg== +"@sinonjs/fake-timers@^9.1.2": + version "9.1.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" + integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== dependencies: "@sinonjs/commons" "^1.7.0" @@ -654,10 +812,30 @@ dependencies: "@babel/runtime" "^7.12.5" -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== "@types/angular@1.6.50": version "1.6.50" @@ -669,7 +847,7 @@ resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== -"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": +"@types/babel__core@^7.1.14": version "7.1.20" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.20.tgz#e168cdd612c92a2d335029ed62ac94c95b362359" integrity sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ== @@ -695,7 +873,7 @@ "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": version "7.18.3" resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.3.tgz#dfc508a85781e5698d5b33443416b6268c4b3e8d" integrity sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w== @@ -710,7 +888,7 @@ "@types/minimatch" "*" "@types/node" "*" -"@types/graceful-fs@^4.1.2": +"@types/graceful-fs@^4.1.3": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== @@ -756,6 +934,15 @@ dependencies: jest-diff "^24.3.0" +"@types/jsdom@^20.0.0": + version "20.0.1" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-20.0.1.tgz#07c14bc19bd2f918c1929541cdaacae894744808" + integrity sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ== + dependencies: + "@types/node" "*" + "@types/tough-cookie" "*" + parse5 "^7.0.0" + "@types/minimatch@*": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" @@ -839,6 +1026,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== +"@types/tough-cookie@*": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.2.tgz#6286b4c7228d58ab7866d19716f3696e03a09397" + integrity sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw== + "@types/yargs-parser@*": version "21.0.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" @@ -851,10 +1043,10 @@ dependencies: "@types/yargs-parser" "*" -"@types/yargs@^16.0.0": - version "16.0.4" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" - integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== +"@types/yargs@^17.0.8": + version "17.0.19" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.19.tgz#8dbecdc9ab48bee0cb74f6e3327de3fa0d0c98ae" + integrity sha512-cAx3qamwaYX9R0fzOIZAlFpo4A+1uBVCxqpKz9D26uTF4srRXaGTTsikQmaotCtNdbhzyUH7ft6p9ktz9s6UNQ== dependencies: "@types/yargs-parser" "*" @@ -1013,35 +1205,30 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -abab@^2.0.3, abab@^2.0.5: +abab@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== -acorn-globals@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" - integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== +acorn-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-7.0.1.tgz#0dbf05c44fa7c94332914c02066d5beff62c40c3" + integrity sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q== dependencies: - acorn "^7.1.1" - acorn-walk "^7.1.1" + acorn "^8.1.0" + acorn-walk "^8.0.2" -acorn-walk@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" - integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn-walk@^8.0.2, acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== acorn@^6.4.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^7.1.1: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -acorn@^8.2.4: +acorn@^8.1.0, acorn@^8.4.1, acorn@^8.8.1: version "8.8.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== @@ -1153,6 +1340,11 @@ arch@^2.1.2: resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1265,16 +1457,15 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -babel-jest@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" - integrity sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg== +babel-jest@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.1.tgz#05c83e0d128cd48c453eea851482a38782249f44" + integrity sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA== dependencies: - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/transform" "^29.3.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^27.5.1" + babel-preset-jest "^29.2.0" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -1290,14 +1481,14 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz#9be98ecf28c331eb9f5df9c72d6f89deb8181c2e" - integrity sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ== +babel-plugin-jest-hoist@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.2.0.tgz#23ee99c37390a98cfddf3ef4a78674180d823094" + integrity sha512-TnspP2WNiR3GLfCsUNHqeXw0RoQ2f9U5hQ5L3XFpwuO8htQmSrhh8qsB6vi5Yi8+kuynN1yjDjQsPfkebmB6ZA== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" - "@types/babel__core" "^7.0.0" + "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: @@ -1318,12 +1509,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz#91f10f58034cb7989cb4f962b69fa6eef6a6bc81" - integrity sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag== +babel-preset-jest@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.2.0.tgz#3048bea3a1af222e3505e4a767a974c95a7620dc" + integrity sha512-z9JmMJppMxNv8N7fNRHvhMg9cvIkMxQBXgFkane3yKVEvEOP+kB50lk8DFRvF9PGqbyXxlmebKWhuDORO8RgdA== dependencies: - babel-plugin-jest-hoist "^27.5.1" + babel-plugin-jest-hoist "^29.2.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1434,11 +1625,6 @@ brorand@^1.0.1, brorand@^1.1.0: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== -browser-process-hrtime@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" - integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== - browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" @@ -1791,13 +1977,13 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== dependencies: string-width "^4.2.0" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" wrap-ansi "^7.0.0" co@^4.6.0: @@ -1904,11 +2090,16 @@ constants-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" integrity sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ== -convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: +convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.9.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" @@ -1977,6 +2168,11 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -2014,10 +2210,10 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" -cssom@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" - integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== +cssom@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.5.0.tgz#d254fa92cd8b6fbd83811b9fbaed34663cc17c36" + integrity sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw== cssom@~0.3.6: version "0.3.8" @@ -2099,14 +2295,14 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-urls@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" - integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== +data-urls@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143" + integrity sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ== dependencies: - abab "^2.0.3" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" + abab "^2.0.6" + whatwg-mimetype "^3.0.0" + whatwg-url "^11.0.0" date-fns@^1.27.2: version "1.30.1" @@ -2151,7 +2347,7 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -decimal.js@^10.2.1: +decimal.js@^10.4.2: version "10.4.3" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== @@ -2240,10 +2436,15 @@ diff-sequences@^24.9.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== -diff-sequences@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" - integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== +diff-sequences@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" + integrity sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== diffie-hellman@^5.0.0: version "5.0.3" @@ -2271,12 +2472,12 @@ domain-browser@^1.1.1: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== -domexception@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" - integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== +domexception@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-4.0.0.tgz#4ad1be56ccadc86fc76d033353999a8037d03673" + integrity sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw== dependencies: - webidl-conversions "^5.0.0" + webidl-conversions "^7.0.0" duplexify@^3.4.2, duplexify@^3.6.0: version "3.7.1" @@ -2319,10 +2520,10 @@ elliptic@^6.5.3: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -emittery@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" - integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== emoji-regex@^8.0.0: version "8.0.0" @@ -2359,6 +2560,11 @@ enhanced-resolve@~0.9.0: memory-fs "^0.2.0" tapable "^0.1.8" +entities@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174" + integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA== + errno@^0.1.3, errno@~0.1.7: version "0.1.8" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" @@ -2587,15 +2793,16 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" - integrity sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw== +expect@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.1.tgz#92877aad3f7deefc2e3f6430dd195b92295554a6" + integrity sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA== dependencies: - "@jest/types" "^27.5.1" - jest-get-type "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" + "@jest/expect-utils" "^29.3.1" + jest-get-type "^29.2.0" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" extend-shallow@^2.0.1: version "2.0.1" @@ -2667,7 +2874,7 @@ fast-glob@^3.0.3: merge2 "^1.3.0" micromatch "^4.0.4" -fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -2787,10 +2994,10 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -2954,7 +3161,7 @@ glob-parent@^3.1.0, glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.2.3: +glob@^7.1.3, glob@^7.1.4, glob@^7.2.3: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -3090,24 +3297,24 @@ hosted-git-info@^2.1.4, hosted-git-info@^2.8.9: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== -html-encoding-sniffer@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" - integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== +html-encoding-sniffer@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz#2cb1a8cf0db52414776e5b2a7a04d5dd98158de9" + integrity sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA== dependencies: - whatwg-encoding "^1.0.5" + whatwg-encoding "^2.0.0" html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== dependencies: - "@tootallnate/once" "1" + "@tootallnate/once" "2" agent-base "6" debug "4" @@ -3125,7 +3332,7 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== -https-proxy-agent@^5.0.0: +https-proxy-agent@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== @@ -3160,12 +3367,12 @@ husky@^3.0.0: run-node "^1.0.0" slash "^3.0.0" -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== +iconv-lite@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== dependencies: - safer-buffer ">= 2.1.2 < 3" + safer-buffer ">= 2.1.2 < 3.0.0" ieee754@^1.1.4: version "1.2.1" @@ -3455,7 +3662,7 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-typedarray@^1.0.0, is-typedarray@~1.0.0: +is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== @@ -3544,85 +3751,82 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.1.tgz#a348aed00ec9bf671cc58a66fcbe7c3dfd6a68f5" - integrity sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw== +jest-changed-files@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.2.0.tgz#b6598daa9803ea6a4dce7968e20ab380ddbee289" + integrity sha512-qPVmLLyBmvF5HJrY7krDisx6Voi8DmlV3GZYX0aFNbaQsZeoz1hfxcCMbqDGuQCxU1dJy9eYc2xscE8QrCCYaA== dependencies: - "@jest/types" "^27.5.1" execa "^5.0.0" - throat "^6.0.1" + p-limit "^3.1.0" -jest-circus@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.1.tgz#37a5a4459b7bf4406e53d637b49d22c65d125ecc" - integrity sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw== +jest-circus@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.3.1.tgz#177d07c5c0beae8ef2937a67de68f1e17bbf1b4a" + integrity sha512-wpr26sEvwb3qQQbdlmei+gzp6yoSSoSL6GsLPxnuayZSMrSd5Ka7IjAvatpIernBvT2+Ic6RLTg+jSebScmasg== dependencies: - "@jest/environment" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/environment" "^29.3.1" + "@jest/expect" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.5.1" is-generator-fn "^2.0.0" - jest-each "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" + jest-each "^29.3.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-runtime "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" + p-limit "^3.1.0" + pretty-format "^29.3.1" slash "^3.0.0" stack-utils "^2.0.3" - throat "^6.0.1" -jest-cli@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.1.tgz#278794a6e6458ea8029547e6c6cbf673bd30b145" - integrity sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw== +jest-cli@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.3.1.tgz#e89dff427db3b1df50cea9a393ebd8640790416d" + integrity sha512-TO/ewvwyvPOiBBuWZ0gm04z3WWP8TIK8acgPzE4IxgsLKQgb377NYGrQLc3Wl/7ndWzIH2CDNNsUjGxwLL43VQ== dependencies: - "@jest/core" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/core" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-config "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" prompts "^2.0.1" - yargs "^16.2.0" + yargs "^17.3.1" -jest-config@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.1.tgz#5c387de33dca3f99ad6357ddeccd91bf3a0e4a41" - integrity sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA== +jest-config@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.3.1.tgz#0bc3dcb0959ff8662957f1259947aedaefb7f3c6" + integrity sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg== dependencies: - "@babel/core" "^7.8.0" - "@jest/test-sequencer" "^27.5.1" - "@jest/types" "^27.5.1" - babel-jest "^27.5.1" + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.3.1" + "@jest/types" "^29.3.1" + babel-jest "^29.3.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" - glob "^7.1.1" + glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^27.5.1" - jest-environment-jsdom "^27.5.1" - jest-environment-node "^27.5.1" - jest-get-type "^27.5.1" - jest-jasmine2 "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-runner "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-circus "^29.3.1" + jest-environment-node "^29.3.1" + jest-get-type "^29.2.0" + jest-regex-util "^29.2.0" + jest-resolve "^29.3.1" + jest-runner "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^27.5.1" + pretty-format "^29.3.1" slash "^3.0.0" strip-json-comments "^3.1.1" @@ -3636,322 +3840,294 @@ jest-diff@^24.3.0: jest-get-type "^24.9.0" pretty-format "^24.9.0" -jest-diff@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" - integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== +jest-diff@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.3.1.tgz#d8215b72fed8f1e647aed2cae6c752a89e757527" + integrity sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw== dependencies: chalk "^4.0.0" - diff-sequences "^27.5.1" - jest-get-type "^27.5.1" - pretty-format "^27.5.1" + diff-sequences "^29.3.1" + jest-get-type "^29.2.0" + pretty-format "^29.3.1" -jest-docblock@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" - integrity sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ== +jest-docblock@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.2.0.tgz#307203e20b637d97cee04809efc1d43afc641e82" + integrity sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A== dependencies: detect-newline "^3.0.0" -jest-each@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.1.tgz#5bc87016f45ed9507fed6e4702a5b468a5b2c44e" - integrity sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ== +jest-each@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.3.1.tgz#bc375c8734f1bb96625d83d1ca03ef508379e132" + integrity sha512-qrZH7PmFB9rEzCSl00BWjZYuS1BSOH8lLuC0azQE9lQrAx3PWGKHTDudQiOSwIy5dGAJh7KA0ScYlCP7JxvFYA== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^29.3.1" chalk "^4.0.0" - jest-get-type "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" - -jest-environment-jsdom@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz#ea9ccd1fc610209655a77898f86b2b559516a546" - integrity sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" + jest-get-type "^29.2.0" + jest-util "^29.3.1" + pretty-format "^29.3.1" + +jest-environment-jsdom@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.3.1.tgz#14ca63c3e0ef5c63c5bcb46033e50bc649e3b639" + integrity sha512-G46nKgiez2Gy4zvYNhayfMEAFlVHhWfncqvqS6yCd0i+a4NsSUD2WtrKSaYQrYiLQaupHXxCRi8xxVL2M9PbhA== + dependencies: + "@jest/environment" "^29.3.1" + "@jest/fake-timers" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/jsdom" "^20.0.0" "@types/node" "*" - jest-mock "^27.5.1" - jest-util "^27.5.1" - jsdom "^16.6.0" - -jest-environment-node@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.1.tgz#dedc2cfe52fab6b8f5714b4808aefa85357a365e" - integrity sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" + jest-mock "^29.3.1" + jest-util "^29.3.1" + jsdom "^20.0.0" + +jest-environment-node@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.3.1.tgz#5023b32472b3fba91db5c799a0d5624ad4803e74" + integrity sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag== + dependencies: + "@jest/environment" "^29.3.1" + "@jest/fake-timers" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" - jest-mock "^27.5.1" - jest-util "^27.5.1" + jest-mock "^29.3.1" + jest-util "^29.3.1" jest-get-type@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== -jest-get-type@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" - integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== +jest-get-type@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" + integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== -jest-haste-map@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" - integrity sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng== +jest-haste-map@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.3.1.tgz#af83b4347f1dae5ee8c2fb57368dc0bb3e5af843" + integrity sha512-/FFtvoG1xjbbPXQLFef+WSU4yrc0fc0Dds6aRPBojUid7qlPqZvxdUBA03HW0fnVHXVCnCdkuoghYItKNzc/0A== dependencies: - "@jest/types" "^27.5.1" - "@types/graceful-fs" "^4.1.2" + "@jest/types" "^29.3.1" + "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^27.5.1" - jest-serializer "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" + jest-regex-util "^29.2.0" + jest-util "^29.3.1" + jest-worker "^29.3.1" micromatch "^4.0.4" - walker "^1.0.7" + walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz#a037b0034ef49a9f3d71c4375a796f3b230d1ac4" - integrity sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/source-map" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - expect "^27.5.1" - is-generator-fn "^2.0.0" - jest-each "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" - throat "^6.0.1" - -jest-leak-detector@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" - integrity sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ== +jest-leak-detector@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.3.1.tgz#95336d020170671db0ee166b75cd8ef647265518" + integrity sha512-3DA/VVXj4zFOPagGkuqHnSQf1GZBmmlagpguxEERO6Pla2g84Q1MaVIB3YMxgUaFIaYag8ZnTyQgiZ35YEqAQA== dependencies: - jest-get-type "^27.5.1" - pretty-format "^27.5.1" + jest-get-type "^29.2.0" + pretty-format "^29.3.1" -jest-matcher-utils@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" - integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== +jest-matcher-utils@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.3.1.tgz#6e7f53512f80e817dfa148672bd2d5d04914a572" + integrity sha512-fkRMZUAScup3txIKfMe3AIZZmPEjWEdsPJFK3AIy5qRohWqQFg1qrmKfYXR9qEkNc7OdAu2N4KPHibEmy4HPeQ== dependencies: chalk "^4.0.0" - jest-diff "^27.5.1" - jest-get-type "^27.5.1" - pretty-format "^27.5.1" + jest-diff "^29.3.1" + jest-get-type "^29.2.0" + pretty-format "^29.3.1" -jest-message-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" - integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== +jest-message-util@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.3.1.tgz#37bc5c468dfe5120712053dd03faf0f053bd6adb" + integrity sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.5.1" + "@jest/types" "^29.3.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^27.5.1" + pretty-format "^29.3.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" - integrity sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og== +jest-mock@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.3.1.tgz#60287d92e5010979d01f218c6b215b688e0f313e" + integrity sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^29.3.1" "@types/node" "*" + jest-util "^29.3.1" jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== -jest-regex-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.1.tgz#4da143f7e9fd1e542d4aa69617b38e4a78365b95" - integrity sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg== +jest-regex-util@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" + integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== -jest-resolve-dependencies@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz#d811ecc8305e731cc86dd79741ee98fed06f1da8" - integrity sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg== +jest-resolve-dependencies@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.3.1.tgz#a6a329708a128e68d67c49f38678a4a4a914c3bf" + integrity sha512-Vk0cYq0byRw2WluNmNWGqPeRnZ3p3hHmjJMp2dyyZeYIfiBskwq4rpiuGFR6QGAdbj58WC7HN4hQHjf2mpvrLA== dependencies: - "@jest/types" "^27.5.1" - jest-regex-util "^27.5.1" - jest-snapshot "^27.5.1" + jest-regex-util "^29.2.0" + jest-snapshot "^29.3.1" -jest-resolve@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" - integrity sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw== +jest-resolve@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.3.1.tgz#9a4b6b65387a3141e4a40815535c7f196f1a68a7" + integrity sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw== dependencies: - "@jest/types" "^27.5.1" chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" + jest-haste-map "^29.3.1" jest-pnp-resolver "^1.2.2" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.1.tgz#071b27c1fa30d90540805c5645a0ec167c7b62e5" - integrity sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ== - dependencies: - "@jest/console" "^27.5.1" - "@jest/environment" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" +jest-runner@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.3.1.tgz#a92a879a47dd096fea46bb1517b0a99418ee9e2d" + integrity sha512-oFvcwRNrKMtE6u9+AQPMATxFcTySyKfLhvso7Sdk/rNpbhg4g2GAGCopiInk1OP4q6gz3n6MajW4+fnHWlU3bA== + dependencies: + "@jest/console" "^29.3.1" + "@jest/environment" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" - emittery "^0.8.1" + emittery "^0.13.1" graceful-fs "^4.2.9" - jest-docblock "^27.5.1" - jest-environment-jsdom "^27.5.1" - jest-environment-node "^27.5.1" - jest-haste-map "^27.5.1" - jest-leak-detector "^27.5.1" - jest-message-util "^27.5.1" - jest-resolve "^27.5.1" - jest-runtime "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" - source-map-support "^0.5.6" - throat "^6.0.1" - -jest-runtime@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.1.tgz#4896003d7a334f7e8e4a53ba93fb9bcd3db0a1af" - integrity sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/globals" "^27.5.1" - "@jest/source-map" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + jest-docblock "^29.2.0" + jest-environment-node "^29.3.1" + jest-haste-map "^29.3.1" + jest-leak-detector "^29.3.1" + jest-message-util "^29.3.1" + jest-resolve "^29.3.1" + jest-runtime "^29.3.1" + jest-util "^29.3.1" + jest-watcher "^29.3.1" + jest-worker "^29.3.1" + p-limit "^3.1.0" + source-map-support "0.5.13" + +jest-runtime@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.3.1.tgz#21efccb1a66911d6d8591276a6182f520b86737a" + integrity sha512-jLzkIxIqXwBEOZx7wx9OO9sxoZmgT2NhmQKzHQm1xwR1kNW/dn0OjxR424VwHHf1SPN6Qwlb5pp1oGCeFTQ62A== + dependencies: + "@jest/environment" "^29.3.1" + "@jest/fake-timers" "^29.3.1" + "@jest/globals" "^29.3.1" + "@jest/source-map" "^29.2.0" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" - execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-message-util "^27.5.1" - jest-mock "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" + jest-haste-map "^29.3.1" + jest-message-util "^29.3.1" + jest-mock "^29.3.1" + jest-regex-util "^29.2.0" + jest-resolve "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-serializer@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.1.tgz#81438410a30ea66fd57ff730835123dea1fb1f64" - integrity sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w== - dependencies: - "@types/node" "*" - graceful-fs "^4.2.9" - -jest-snapshot@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.1.tgz#b668d50d23d38054a51b42c4039cab59ae6eb6a1" - integrity sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA== +jest-snapshot@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.3.1.tgz#17bcef71a453adc059a18a32ccbd594b8cc4e45e" + integrity sha512-+3JOc+s28upYLI2OJM4PWRGK9AgpsMs/ekNryUV0yMBClT9B1DF2u2qay8YxcQd338PPYSFNb0lsar1B49sLDA== dependencies: - "@babel/core" "^7.7.2" + "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" - "@babel/types" "^7.0.0" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/babel__traverse" "^7.0.4" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.5.1" + expect "^29.3.1" graceful-fs "^4.2.9" - jest-diff "^27.5.1" - jest-get-type "^27.5.1" - jest-haste-map "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-util "^27.5.1" + jest-diff "^29.3.1" + jest-get-type "^29.2.0" + jest-haste-map "^29.3.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" natural-compare "^1.4.0" - pretty-format "^27.5.1" - semver "^7.3.2" + pretty-format "^29.3.1" + semver "^7.3.5" -jest-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" - integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== +jest-util@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.3.1.tgz#1dda51e378bbcb7e3bc9d8ab651445591ed373e1" + integrity sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" - integrity sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ== +jest-validate@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.3.1.tgz#d56fefaa2e7d1fde3ecdc973c7f7f8f25eea704a" + integrity sha512-N9Lr3oYR2Mpzuelp1F8negJR3YE+L1ebk1rYA5qYo9TTY3f9OWdptLoNSPP9itOCBIRBqjt/S5XHlzYglLN67g== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^29.3.1" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.5.1" + jest-get-type "^29.2.0" leven "^3.1.0" - pretty-format "^27.5.1" + pretty-format "^29.3.1" -jest-watcher@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.1.tgz#71bd85fb9bde3a2c2ec4dc353437971c43c642a2" - integrity sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw== +jest-watcher@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.3.1.tgz#3341547e14fe3c0f79f9c3a4c62dbc3fc977fd4a" + integrity sha512-RspXG2BQFDsZSRKGCT/NiNa8RkQ1iKAjrO0//soTMWx/QUt+OcxMqMSBxz23PYGqUuWm2+m2mNNsmj0eIoOaFg== dependencies: - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.5.1" + emittery "^0.13.1" + jest-util "^29.3.1" string-length "^4.0.1" -jest-worker@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" - integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== +jest-worker@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.3.1.tgz#e9462161017a9bb176380d721cab022661da3d6b" + integrity sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw== dependencies: "@types/node" "*" + jest-util "^29.3.1" merge-stream "^2.0.0" supports-color "^8.0.0" @@ -3973,38 +4149,37 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== -jsdom@^16.6.0: - version "16.7.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" - integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== +jsdom@^20.0.0: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-20.0.3.tgz#886a41ba1d4726f67a8858028c99489fed6ad4db" + integrity sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ== dependencies: - abab "^2.0.5" - acorn "^8.2.4" - acorn-globals "^6.0.0" - cssom "^0.4.4" + abab "^2.0.6" + acorn "^8.8.1" + acorn-globals "^7.0.0" + cssom "^0.5.0" cssstyle "^2.3.0" - data-urls "^2.0.0" - decimal.js "^10.2.1" - domexception "^2.0.1" + data-urls "^3.0.2" + decimal.js "^10.4.2" + domexception "^4.0.0" escodegen "^2.0.0" - form-data "^3.0.0" - html-encoding-sniffer "^2.0.1" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" + form-data "^4.0.0" + html-encoding-sniffer "^3.0.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.1" is-potential-custom-element-name "^1.0.1" - nwsapi "^2.2.0" - parse5 "6.0.1" - saxes "^5.0.1" + nwsapi "^2.2.2" + parse5 "^7.1.1" + saxes "^6.0.0" symbol-tree "^3.2.4" - tough-cookie "^4.0.0" - w3c-hr-time "^1.0.2" - w3c-xmlserializer "^2.0.0" - webidl-conversions "^6.1.0" - whatwg-encoding "^1.0.5" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.5.0" - ws "^7.4.6" - xml-name-validator "^3.0.0" + tough-cookie "^4.1.2" + w3c-xmlserializer "^4.0.0" + webidl-conversions "^7.0.0" + whatwg-encoding "^2.0.0" + whatwg-mimetype "^3.0.0" + whatwg-url "^11.0.0" + ws "^8.11.0" + xml-name-validator "^4.0.0" jsesc@^2.5.1: version "2.5.2" @@ -4048,6 +4223,11 @@ json5@^2.2.1: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== +json5@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + jsonfile@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" @@ -4203,7 +4383,7 @@ lodash.once@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== -lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0: +lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -4281,6 +4461,11 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + makeerror@1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" @@ -4606,7 +4791,7 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== -nwsapi@^2.2.0: +nwsapi@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.2.tgz#e5418863e7905df67d51ec95938d67bf801f0bb0" integrity sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw== @@ -4709,6 +4894,13 @@ p-limit@^2.0.0, p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -4783,10 +4975,12 @@ parse-json@^5.0.0, parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -parse5@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" - integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== +parse5@^7.0.0, parse5@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" + integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + dependencies: + entities "^4.4.0" pascalcase@^0.1.1: version "0.1.1" @@ -4925,7 +5119,7 @@ pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" -pretty-format@^27.0.2, pretty-format@^27.5.1: +pretty-format@^27.0.2: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== @@ -4934,6 +5128,15 @@ pretty-format@^27.0.2, pretty-format@^27.5.1: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da" + integrity sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg== + dependencies: + "@jest/schemas" "^29.0.0" + ansi-styles "^5.0.0" + react-is "^18.0.0" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -5084,6 +5287,11 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-is@^18.0.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== + read-pkg@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" @@ -5309,15 +5517,15 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -saxes@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" - integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== +saxes@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" + integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== dependencies: xmlchars "^2.2.0" @@ -5345,7 +5553,7 @@ semver@^6.0.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.2: +semver@^7.3.5: version "7.3.8" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== @@ -5411,7 +5619,7 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: +signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -5477,7 +5685,15 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.6, source-map-support@~0.5.12: +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-support@~0.5.12: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== @@ -5500,11 +5716,6 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3: - version "0.7.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" - integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== - spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -5642,7 +5853,7 @@ string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^4.1.0, string-width@^4.2.0: +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -5727,7 +5938,7 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^7.0.0, supports-color@^7.1.0, supports-color@^7.2.0: +supports-color@^7.1.0, supports-color@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== @@ -5741,14 +5952,6 @@ supports-color@^8.0.0: dependencies: has-flag "^4.0.0" -supports-hyperlinks@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624" - integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA== - dependencies: - has-flag "^4.0.0" - supports-color "^7.0.0" - supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" @@ -5774,14 +5977,6 @@ tapable@^1.0.0, tapable@^1.1.3: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -terminal-link@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" - integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== - dependencies: - ansi-escapes "^4.2.1" - supports-hyperlinks "^2.0.0" - terser-webpack-plugin@^1.4.3: version "1.4.5" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz#a217aefaea330e734ffacb6120ec1fa312d6040b" @@ -5815,11 +6010,6 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -throat@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" - integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== - throttleit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" @@ -5899,7 +6089,7 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -tough-cookie@^4.0.0: +tough-cookie@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.2.tgz#e53e84b85f24e0b65dd526f46628db6c85f6b874" integrity sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ== @@ -5917,10 +6107,10 @@ tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" -tr46@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" - integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== +tr46@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" + integrity sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA== dependencies: punycode "^2.1.1" @@ -5935,6 +6125,25 @@ ts-loader@^6.2.1: micromatch "^4.0.0" semver "^6.0.0" +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + tslib@^1.10.0, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -5979,13 +6188,6 @@ type-fest@^0.6.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -6108,14 +6310,19 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -v8-to-istanbul@^8.1.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" - integrity sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w== +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +v8-to-istanbul@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4" + integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w== dependencies: + "@jridgewell/trace-mapping" "^0.3.12" "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" - source-map "^0.7.3" validate-npm-package-license@^3.0.1: version "3.0.4" @@ -6139,21 +6346,14 @@ vm-browserify@^1.0.1: resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== -w3c-hr-time@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" - integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== - dependencies: - browser-process-hrtime "^1.0.0" - -w3c-xmlserializer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" - integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== +w3c-xmlserializer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073" + integrity sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw== dependencies: - xml-name-validator "^3.0.0" + xml-name-validator "^4.0.0" -walker@^1.0.7: +walker@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== @@ -6178,15 +6378,10 @@ watchpack@^1.7.4: chokidar "^3.4.1" watchpack-chokidar2 "^2.0.1" -webidl-conversions@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" - integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== - -webidl-conversions@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" - integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== +webidl-conversions@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" + integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== webpack-sources@^1.4.0, webpack-sources@^1.4.1: version "1.4.3" @@ -6225,26 +6420,25 @@ webpack@^4.41.5: watchpack "^1.7.4" webpack-sources "^1.4.1" -whatwg-encoding@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== +whatwg-encoding@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz#e7635f597fd87020858626805a2729fa7698ac53" + integrity sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg== dependencies: - iconv-lite "0.4.24" + iconv-lite "0.6.3" -whatwg-mimetype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== +whatwg-mimetype@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7" + integrity sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q== -whatwg-url@^8.0.0, whatwg-url@^8.5.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" - integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== +whatwg-url@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" + integrity sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ== dependencies: - lodash "^4.7.0" - tr46 "^2.1.0" - webidl-conversions "^6.1.0" + tr46 "^3.0.0" + webidl-conversions "^7.0.0" which-module@^2.0.0: version "2.0.0" @@ -6308,25 +6502,23 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write-file-atomic@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" - integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== +write-file-atomic@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== dependencies: imurmurhash "^0.1.4" - is-typedarray "^1.0.0" - signal-exit "^3.0.2" - typedarray-to-buffer "^3.1.5" + signal-exit "^3.0.7" -ws@^7.4.6: - version "7.5.9" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== +ws@^8.11.0: + version "8.11.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" + integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg== -xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== +xml-name-validator@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835" + integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw== xmlchars@^2.2.0: version "2.2.0" @@ -6371,10 +6563,10 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs@^15.3.1: version "15.4.1" @@ -6393,18 +6585,18 @@ yargs@^15.3.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== +yargs@^17.3.1: + version "17.6.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" + integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw== dependencies: - cliui "^7.0.2" + cliui "^8.0.1" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" - string-width "^4.2.0" + string-width "^4.2.3" y18n "^5.0.5" - yargs-parser "^20.2.2" + yargs-parser "^21.1.1" yauzl@^2.10.0: version "2.10.0" @@ -6413,3 +6605,13 @@ yauzl@^2.10.0: dependencies: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 8381d3250d765e51ee835cd13035609df31aa1ff Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Fri, 3 Feb 2023 14:17:38 +0100 Subject: [PATCH 16/48] unit tests review Signed-off-by: Jovan Cvetkovic --- public/components/FormFieldHeader/FormFieldHeader.test.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/public/components/FormFieldHeader/FormFieldHeader.test.tsx b/public/components/FormFieldHeader/FormFieldHeader.test.tsx index e14d95044..0ce747854 100644 --- a/public/components/FormFieldHeader/FormFieldHeader.test.tsx +++ b/public/components/FormFieldHeader/FormFieldHeader.test.tsx @@ -9,11 +9,7 @@ import { FormFieldHeader } from './FormFieldHeader'; describe(' spec', () => { it('renders the component', () => { - const tree = render( - - ); + const tree = render(); expect(tree).toMatchSnapshot(); }); From 2933d637cc5e6abaa262d4db6f95e96304651095 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Fri, 3 Feb 2023 15:32:48 +0100 Subject: [PATCH 17/48] unit tests review Signed-off-by: Jovan Cvetkovic --- .../Alerts/containers/Alerts/Alerts.test.tsx | 2 +- .../DetectorRulesView.test.tsx.snap | 26 +- .../UpdateDetectorBasicDetails.test.tsx.snap | 909 +++--------------- .../AlertTriggersView.test.tsx.snap | 380 +------- .../DetectorDetails.test.tsx.snap | 80 +- .../DetectorDetailsView.test.tsx.snap | 62 +- .../AlertTriggersView.mock.ts | 5 +- .../containers/Detectors/Detector.mock.ts | 10 +- .../Detectors/DetectorInput.mock.ts | 6 +- .../Detectors/DetectorResponse.mock.ts | 4 +- .../containers/Detectors/Detectors.mock.ts | 10 +- test/mocks/services/alertService.mock.ts | 6 +- test/mocks/services/detectorService.mock.ts | 6 +- .../services/fieldMappingService.mock.ts | 2 +- test/mocks/services/findingsService.mock.ts | 2 +- .../iLegacyCustomClusterClient.mock.ts | 15 + test/mocks/services/index.ts | 2 + test/mocks/services/indexService.mock.ts | 15 + .../NotificationChannelTypeOptions.mock.ts | 5 +- .../notificationsService.mock.ts | 11 +- test/mocks/services/ruleService.mock.ts | 2 +- .../{context.mock.ts => useContext.mock.ts} | 0 test/setup.jest.ts | 110 +-- 23 files changed, 402 insertions(+), 1268 deletions(-) create mode 100644 test/mocks/services/iLegacyCustomClusterClient.mock.ts create mode 100644 test/mocks/services/indexService.mock.ts rename test/mocks/{context.mock.ts => useContext.mock.ts} (100%) diff --git a/public/pages/Alerts/containers/Alerts/Alerts.test.tsx b/public/pages/Alerts/containers/Alerts/Alerts.test.tsx index 53cf629ca..7a2e48084 100644 --- a/public/pages/Alerts/containers/Alerts/Alerts.test.tsx +++ b/public/pages/Alerts/containers/Alerts/Alerts.test.tsx @@ -5,7 +5,7 @@ import React from 'react'; import Alerts from './Alerts'; -import contextMock from '../../../../../test/mocks/context.mock'; +import contextMock from '../../../../../test/mocks/useContext.mock'; import { mount } from 'enzyme'; import alertsMock from '../../../../../test/mocks/Alerts/Alerts.mock'; import { shallowToJson } from 'enzyme-to-json'; diff --git a/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap b/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap index df921a703..5ea7c43a2 100644 --- a/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap +++ b/public/pages/Detectors/components/DetectorRulesView/__snapshots__/DetectorRulesView.test.tsx.snap @@ -177,7 +177,23 @@ exports[` spec renders the component 1`] = ` notifications={ Object { "toasts": Object { - "addDanger": [MockFunction], + "addDanger": [MockFunction] { + "calls": Array [ + Array [ + Object { + "text": [TypeError: Cannot read property 'getRules' of undefined], + "title": "Failed to retrieve rules:", + "toastLifeTimeMs": 5000, + }, + ], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, }, } } @@ -336,7 +352,7 @@ exports[` spec renders the component 1`] = ` } > @@ -383,7 +399,7 @@ exports[` spec renders the component 1`] = ` ] } items={Array []} - loading={false} + loading={true} onTableChange={[Function]} pagination={ Object { @@ -1325,7 +1341,7 @@ exports[` spec renders the component 1`] = ` ] } items={Array []} - loading={false} + loading={true} noItemsMessage="No items found" onChange={[Function]} pagination={ @@ -1351,7 +1367,7 @@ exports[` spec renders the component 1`] = ` tableLayout="fixed" >
diff --git a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap index 12f7d3dd3..3b874a2c7 100644 --- a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap +++ b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap @@ -186,373 +186,7 @@ exports[` spec renders the component 1`] = ` "location": Object { "pathname": "", }, - "replace": [MockFunction] { - "calls": Array [ - Array [ - Object { - "pathname": "/edit-detector-details/detector_id_1", - "state": Object { - "detectorHit": Object { - "_id": "detector_id_1", - "_index": ".windows", - "_source": Object { - "_id": "detector_id_1", - "_index": ".windows", - "_source": Object { - "createdBy": "someone", - "detector_type": "detector_type", - "enabled": true, - "enabled_time": 1, - "id": "detector_id_1", - "inputs": Array [ - Object { - "detector_input": Object { - "custom_rules": Array [ - Object { - "_id": "rule_id_1", - "_index": ".windows", - "_primary_term": 1, - "_source": Object { - "last_update_time": "12/12/2022", - "queries": Array [ - Object { - "value": ".windows", - }, - ], - "rule": "rule_name", - }, - "_version": 1, - }, - ], - "description": "detectorDescription", - "indices": Array [ - ".windows", - ], - "pre_packaged_rules": Array [ - Object { - "_id": "rule_id_1", - "_index": ".windows", - "_primary_term": 1, - "_source": Object { - "last_update_time": "12/12/2022", - "queries": Array [ - Object { - "value": ".windows", - }, - ], - "rule": "rule_name", - }, - "_version": 1, - }, - ], - }, - }, - ], - "last_update_time": 1, - "name": "detector_name", - "schedule": Object { - "period": Object { - "interval": 1, - "unit": "minute", - }, - }, - "triggers": Array [ - Object { - "actions": Array [ - Object { - "destination_id": "some_destination_id_1", - "id": "trigger_id_1_0", - "message_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "name": "some_name", - "subject_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "throttle": Object { - "unit": "minutes", - "value": 1, - }, - "throttle_enabled": true, - }, - Object { - "destination_id": "some_destination_id_1", - "id": "trigger_id_1_1", - "message_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "name": "some_name", - "subject_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "throttle": Object { - "unit": "minutes", - "value": 1, - }, - "throttle_enabled": true, - }, - ], - "id": "trigger_id_0", - "ids": Array [ - "rule_id_1", - ], - "name": "alert_name", - "sev_levels": Array [ - "severity_level_low", - ], - "severity": "1", - "tags": Array [ - "any.tag", - ], - "types": Array [ - "detector_type_1", - ], - }, - Object { - "actions": Array [ - Object { - "destination_id": "some_destination_id_1", - "id": "trigger_id_1_0", - "message_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "name": "some_name", - "subject_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "throttle": Object { - "unit": "minutes", - "value": 1, - }, - "throttle_enabled": true, - }, - Object { - "destination_id": "some_destination_id_1", - "id": "trigger_id_1_1", - "message_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "name": "some_name", - "subject_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "throttle": Object { - "unit": "minutes", - "value": 1, - }, - "throttle_enabled": true, - }, - ], - "id": "trigger_id_1", - "ids": Array [ - "rule_id_1", - ], - "name": "alert_name", - "sev_levels": Array [ - "severity_level_low", - ], - "severity": "1", - "tags": Array [ - "any.tag", - ], - "types": Array [ - "detector_type_1", - ], - }, - ], - "type": "detector", - }, - "createdBy": "someone", - "detector_type": "detector_type", - "enabled": true, - "enabled_time": 1, - "id": "detector_id_1", - "inputs": Array [ - Object { - "detector_input": Object { - "custom_rules": Array [ - Object { - "_id": "rule_id_1", - "_index": ".windows", - "_primary_term": 1, - "_source": Object { - "last_update_time": "12/12/2022", - "queries": Array [ - Object { - "value": ".windows", - }, - ], - "rule": "rule_name", - }, - "_version": 1, - }, - ], - "description": "detectorDescription", - "indices": Array [ - ".windows", - ], - "pre_packaged_rules": Array [ - Object { - "_id": "rule_id_1", - "_index": ".windows", - "_primary_term": 1, - "_source": Object { - "last_update_time": "12/12/2022", - "queries": Array [ - Object { - "value": ".windows", - }, - ], - "rule": "rule_name", - }, - "_version": 1, - }, - ], - }, - }, - ], - "last_update_time": 1, - "name": "detector_name", - "schedule": Object { - "period": Object { - "interval": 1, - "unit": "minute", - }, - }, - "triggers": Array [ - Object { - "actions": Array [ - Object { - "destination_id": "some_destination_id_1", - "id": "trigger_id_1_0", - "message_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "name": "some_name", - "subject_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "throttle": Object { - "unit": "minutes", - "value": 1, - }, - "throttle_enabled": true, - }, - Object { - "destination_id": "some_destination_id_1", - "id": "trigger_id_1_1", - "message_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "name": "some_name", - "subject_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "throttle": Object { - "unit": "minutes", - "value": 1, - }, - "throttle_enabled": true, - }, - ], - "id": "trigger_id_0", - "ids": Array [ - "rule_id_1", - ], - "name": "alert_name", - "sev_levels": Array [ - "severity_level_low", - ], - "severity": "1", - "tags": Array [ - "any.tag", - ], - "types": Array [ - "detector_type_1", - ], - }, - Object { - "actions": Array [ - Object { - "destination_id": "some_destination_id_1", - "id": "trigger_id_1_0", - "message_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "name": "some_name", - "subject_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "throttle": Object { - "unit": "minutes", - "value": 1, - }, - "throttle_enabled": true, - }, - Object { - "destination_id": "some_destination_id_1", - "id": "trigger_id_1_1", - "message_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "name": "some_name", - "subject_template": Object { - "lang": "some_lang", - "source": "some_source", - }, - "throttle": Object { - "unit": "minutes", - "value": 1, - }, - "throttle_enabled": true, - }, - ], - "id": "trigger_id_1", - "ids": Array [ - "rule_id_1", - ], - "name": "alert_name", - "sev_levels": Array [ - "severity_level_low", - ], - "severity": "1", - "tags": Array [ - "any.tag", - ], - "types": Array [ - "detector_type_1", - ], - }, - ], - "type": "detector", - }, - }, - }, - }, - ], - ], - "results": Array [ - Object { - "type": "return", - "value": undefined, - }, - ], - }, + "replace": [MockFunction], } } location={ @@ -563,7 +197,34 @@ exports[` spec renders the component 1`] = ` notifications={ Object { "toasts": Object { - "addDanger": [MockFunction], + "addDanger": [MockFunction] { + "calls": Array [ + Array [ + Object { + "text": [TypeError: Cannot read property 'getIndices' of undefined], + "title": "Failed to retrieve indices:", + "toastLifeTimeMs": 5000, + }, + ], + Array [ + Object { + "text": [TypeError: Cannot read property 'getDetectors' of undefined], + "title": "Failed to retrieve detector:", + "toastLifeTimeMs": 5000, + }, + ], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + ], + }, }, } } @@ -586,8 +247,8 @@ exports[` spec renders the component 1`] = ` /> spec renders the component 1`] = ` spec renders the component 1`] = ` placeholder="Enter a name for the detector." readOnly={false} required={true} - value="detector_name" + value="" > spec renders the component 1`] = ` readOnly={false} required={true} type="text" - value="detector_name" + value="" /> @@ -844,7 +506,7 @@ exports[` spec renders the component 1`] = ` onChange={[Function]} onFocus={[Function]} placeholder="Enter a description for the detector." - value="detectorDescription" + value="" > -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- -
-
-
-
-
-
-
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-

- If a detection rule matches -

-
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-

- Alert and notify -

-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
- -
-
-
- -
-
-
-
-
- EuiIconMock - - Notifications plugin is not installed - -
-
-
-

- Install the notifications plugin in order to create and select channels to send out notifications.  - - Learn more - EuiIconMock - - . -

-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- -
-
- -
-
-
-
- , - "container":
-
-
-

- Edit alert triggers -

-
+
+ + + + +
+
- Get notified when specific rule conditions are found by the detector. -
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-

- If a detection rule matches -

-
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-

- Alert and notify -

-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
- -
-
-
- -
-
-
-
-
- EuiIconMock - - Notifications plugin is not installed - -
-
-
-

- Install the notifications plugin in order to create and select channels to send out notifications.  - - Learn more - EuiIconMock - - . -

-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
+ + + +
-
-
-
+ +
-
-
-
- -
-
-
-
-
-
-
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-

- If a detection rule matches -

-
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-

- Alert and notify -

-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
- -
-
-
- -
-
-
-
-
- EuiIconMock - - Notifications plugin is not installed - -
-
-
-

- Install the notifications plugin in order to create and select channels to send out notifications.  - - Learn more - EuiIconMock - - . -

-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
+ + + +
-
-
- -
-
-
- -
-
- -
+
-
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} + +
+ `; diff --git a/public/pages/Detectors/components/UpdateBasicDetails/UpdateDetectorBasicDetails.test.tsx b/public/pages/Detectors/components/UpdateBasicDetails/UpdateDetectorBasicDetails.test.tsx index 90269884e..004c3fa34 100644 --- a/public/pages/Detectors/components/UpdateBasicDetails/UpdateDetectorBasicDetails.test.tsx +++ b/public/pages/Detectors/components/UpdateBasicDetails/UpdateDetectorBasicDetails.test.tsx @@ -9,7 +9,12 @@ import { expect } from '@jest/globals'; import { UpdateDetectorBasicDetails } from './UpdateBasicDetails'; import { act } from 'react-dom/test-utils'; import { mount } from 'enzyme'; - +jest.mock( + '../../../CreateDetector/components/DefineDetector/components/DetectorDataSource/DetectorDataSource.tsx', + () => () => { + return ; + } +); describe(' spec', () => { it('renders the component', async () => { let wrapper; diff --git a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap index 945386b73..5e033074f 100644 --- a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap +++ b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap @@ -188,7 +188,377 @@ exports[` spec renders the component 1`] = ` "location": Object { "pathname": "", }, - "replace": [MockFunction], + "replace": [MockFunction] { + "calls": Array [ + Array [ + Object { + "pathname": "/edit-detector-details/detector_id_1", + "state": Object { + "detectorHit": Object { + "_id": "detector_id_1", + "_index": ".windows", + "_source": Object { + "_id": "detector_id_1", + "_index": ".windows", + "_source": Object { + "createdBy": "someone", + "detector_type": "detector_type", + "enabled": true, + "enabled_time": 1, + "id": "detector_id_1", + "inputs": Array [ + Object { + "detector_input": Object { + "custom_rules": Array [ + Object { + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, + "id": "rule_id_1", + }, + ], + "description": "detectorDescription", + "indices": Array [ + ".windows", + ], + "pre_packaged_rules": Array [ + Object { + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, + "id": "rule_id_1", + }, + ], + }, + }, + ], + "last_update_time": 1, + "name": "detector_name", + "schedule": Object { + "period": Object { + "interval": 1, + "unit": "minute", + }, + }, + "triggers": Array [ + Object { + "actions": Array [ + Object { + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", + "message_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "name": "some_name", + "subject_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "throttle": Object { + "unit": "minutes", + "value": 1, + }, + "throttle_enabled": true, + }, + Object { + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", + "message_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "name": "some_name", + "subject_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "throttle": Object { + "unit": "minutes", + "value": 1, + }, + "throttle_enabled": true, + }, + ], + "id": "trigger_id_0", + "ids": Array [ + "rule_id_1", + ], + "name": "alert_name", + "sev_levels": Array [ + "severity_level_low", + ], + "severity": "1", + "tags": Array [ + "any.tag", + ], + "types": Array [ + "detector_type_1", + ], + }, + Object { + "actions": Array [ + Object { + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", + "message_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "name": "some_name", + "subject_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "throttle": Object { + "unit": "minutes", + "value": 1, + }, + "throttle_enabled": true, + }, + Object { + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", + "message_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "name": "some_name", + "subject_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "throttle": Object { + "unit": "minutes", + "value": 1, + }, + "throttle_enabled": true, + }, + ], + "id": "trigger_id_1", + "ids": Array [ + "rule_id_1", + ], + "name": "alert_name", + "sev_levels": Array [ + "severity_level_low", + ], + "severity": "1", + "tags": Array [ + "any.tag", + ], + "types": Array [ + "detector_type_1", + ], + }, + ], + "type": "detector", + }, + "createdBy": "someone", + "detector_type": "detector_type", + "enabled": true, + "enabled_time": 1, + "id": "detector_id_1", + "inputs": Array [ + Object { + "detector_input": Object { + "custom_rules": Array [ + Object { + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, + "id": "rule_id_1", + }, + ], + "description": "detectorDescription", + "indices": Array [ + ".windows", + ], + "pre_packaged_rules": Array [ + Object { + "_id": "rule_id_1", + "_index": ".windows", + "_primary_term": 1, + "_source": Object { + "last_update_time": "12/12/2022", + "queries": Array [ + Object { + "value": ".windows", + }, + ], + "rule": "rule_name", + }, + "_version": 1, + "id": "rule_id_1", + }, + ], + }, + }, + ], + "last_update_time": 1, + "name": "detector_name", + "schedule": Object { + "period": Object { + "interval": 1, + "unit": "minute", + }, + }, + "triggers": Array [ + Object { + "actions": Array [ + Object { + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", + "message_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "name": "some_name", + "subject_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "throttle": Object { + "unit": "minutes", + "value": 1, + }, + "throttle_enabled": true, + }, + Object { + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", + "message_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "name": "some_name", + "subject_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "throttle": Object { + "unit": "minutes", + "value": 1, + }, + "throttle_enabled": true, + }, + ], + "id": "trigger_id_0", + "ids": Array [ + "rule_id_1", + ], + "name": "alert_name", + "sev_levels": Array [ + "severity_level_low", + ], + "severity": "1", + "tags": Array [ + "any.tag", + ], + "types": Array [ + "detector_type_1", + ], + }, + Object { + "actions": Array [ + Object { + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_0", + "message_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "name": "some_name", + "subject_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "throttle": Object { + "unit": "minutes", + "value": 1, + }, + "throttle_enabled": true, + }, + Object { + "destination_id": "some_destination_id_1", + "id": "trigger_id_1_1", + "message_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "name": "some_name", + "subject_template": Object { + "lang": "some_lang", + "source": "some_source", + }, + "throttle": Object { + "unit": "minutes", + "value": 1, + }, + "throttle_enabled": true, + }, + ], + "id": "trigger_id_1", + "ids": Array [ + "rule_id_1", + ], + "name": "alert_name", + "sev_levels": Array [ + "severity_level_low", + ], + "severity": "1", + "tags": Array [ + "any.tag", + ], + "types": Array [ + "detector_type_1", + ], + }, + ], + "type": "detector", + }, + }, + }, + }, + ], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, } } location={ @@ -199,23 +569,7 @@ exports[` spec renders the component 1`] = ` notifications={ Object { "toasts": Object { - "addDanger": [MockFunction] { - "calls": Array [ - Array [ - Object { - "text": [TypeError: Cannot read property 'setBreadcrumbs' of undefined], - "title": "Failed to retrieve detector:", - "toastLifeTimeMs": 5000, - }, - ], - ], - "results": Array [ - Object { - "type": "return", - "value": undefined, - }, - ], - }, + "addDanger": [MockFunction], }, } } @@ -527,7 +881,7 @@ exports[` spec renders the component 1`] = ` className="euiSpacer euiSpacer--xl" /> - spec renders the component 1`] = ` notifications={ Object { "toasts": Object { - "addDanger": [MockFunction] { - "calls": Array [ - Array [ - Object { - "text": [TypeError: Cannot read property 'setBreadcrumbs' of undefined], - "title": "Failed to retrieve detector:", - "toastLifeTimeMs": 5000, - }, - ], - ], - "results": Array [ - Object { - "type": "return", - "value": undefined, - }, - ], - }, + "addDanger": [MockFunction], }, } } onDetectorInputIndicesChange={[Function]} > - - -
- -
- -
- -

- Data source -

-
-
-
-
-
- -
-
-
- -
- - - } - labelType="label" - > -
-
- - - -
-
- -
- - -
-
-
- - - .windows - - - -
- -
-
- -
- -
- - - - - - - - -
-
-
-
- - -
- -
-
- -
-
- - - + + @@ -1823,20 +1758,20 @@ exports[` spec renders the component 1`] = ` className="euiFlexItem euiFlexItem--flexGrowZero" > + + + + + Date: Tue, 21 Feb 2023 11:08:49 +0100 Subject: [PATCH 35/48] [FEATURE] Create detector | Make data source multi-select field #419 Signed-off-by: Jovan Cvetkovic --- .../UpdateAlertConditions/UpdateAlertConditions.mock.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/mocks/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts b/test/mocks/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts index fd98f2c42..e41b6a6e4 100644 --- a/test/mocks/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts +++ b/test/mocks/Detectors/components/UpdateAlertConditions/UpdateAlertConditions.mock.ts @@ -21,5 +21,6 @@ export default ({ state: { detectorHit: detectorHitMock, }, + pathname: '', }, } as unknown) as typeof UpdateAlertConditions; From 25c97cb8ec91c551d13a58ec38cc527642b715a4 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Tue, 21 Feb 2023 11:10:16 +0100 Subject: [PATCH 36/48] [FEATURE] Create detector | Make data source multi-select field #419 Signed-off-by: Jovan Cvetkovic --- .../__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap index e534faf66..5e033074f 100644 --- a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap +++ b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap @@ -831,7 +831,7 @@ exports[` spec renders the component 1`] = ` Description - - optional + - optional
From d7cf62f2af08911d4bbbb65b3e88f16a77f50f49 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Tue, 21 Feb 2023 12:15:04 +0100 Subject: [PATCH 37/48] [FEATURE] Create detector | Make data source multi-select field #419 Signed-off-by: Jovan Cvetkovic --- cypress/integration/1_detectors.spec.js | 39 +++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/cypress/integration/1_detectors.spec.js b/cypress/integration/1_detectors.spec.js index 3d0ff2f0e..871941c82 100644 --- a/cypress/integration/1_detectors.spec.js +++ b/cypress/integration/1_detectors.spec.js @@ -6,6 +6,7 @@ import { OPENSEARCH_DASHBOARDS_URL } from '../support/constants'; import sample_index_settings from '../fixtures/sample_index_settings.json'; import dns_rule_data from '../fixtures/integration_tests/rule/create_dns_rule.json'; +import sample_dns_settings from '../fixtures/integration_tests/index/create_dns_settings.json'; const testMappings = { properties: { @@ -16,7 +17,7 @@ const testMappings = { }, }; -const cypressDNSRule = 'Cypress DNS Rule'; +const cypressDNSRule = dns_rule_data.title; describe('Detectors', () => { const indexName = 'cypress-test-dns'; @@ -24,6 +25,7 @@ describe('Detectors', () => { before(() => { cy.cleanUpTests(); + // Create test index cy.createIndex(indexName, sample_index_settings).then(() => cy @@ -41,8 +43,6 @@ describe('Detectors', () => { ); cy.createRule(dns_rule_data); - - cy.contains(detectorName).should('not.exist'); }); beforeEach(() => { @@ -57,6 +57,39 @@ describe('Detectors', () => { }); }); + it('...should show mappings warning', () => { + const indexName = 'cypress-index-windows'; + const dnsName = 'cypress-index-dns'; + cy.createIndex(indexName, sample_index_settings); + cy.createIndex(dnsName, sample_dns_settings); + + // Locate Create detector button click to start + cy.get('.euiButton').filter(':contains("Create detector")').click({ force: true }); + + // Check to ensure process started + cy.waitForPageLoad('create-detector', { + contains: 'Define detector', + }); + + // Select our pre-seeded data source (check indexName) + cy.get(`[data-test-subj="define-detector-select-data-source"]`) + .find('input') + .focus() + .realType(indexName); + + // Select threat detector type (Windows logs) + cy.get(`input[id="dns"]`).click({ force: true }); + + // Select our pre-seeded data source (check indexName) + cy.get(`[data-test-subj="define-detector-select-data-source"]`) + .find('input') + .focus() + .realType(dnsName) + .realPress('Enter'); + + cy.get('.euiCallOut').should('be.visible').contains('Detector configuration warning'); + }); + it('...can be created', () => { // Locate Create detector button click to start cy.get('.euiButton').filter(':contains("Create detector")').click({ force: true }); From b2b15da3a15552f4b49b28f3e5b65a24b2563664 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Tue, 21 Feb 2023 12:24:19 +0100 Subject: [PATCH 38/48] [FEATURE] Create detector | Make data source multi-select field #419 Signed-off-by: Jovan Cvetkovic --- .../components/DefineDetector/containers/DefineDetector.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx b/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx index 195aa75bd..e3f0d32cb 100644 --- a/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx @@ -79,7 +79,7 @@ export default class DefineDetector extends Component Date: Tue, 21 Feb 2023 12:33:42 +0100 Subject: [PATCH 39/48] [FEATURE] Create detector | Make data source multi-select field #419 Signed-off-by: Jovan Cvetkovic --- .../RequiredFieldMapping/FieldMappingsTable.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public/pages/CreateDetector/components/ConfigureFieldMapping/components/RequiredFieldMapping/FieldMappingsTable.tsx b/public/pages/CreateDetector/components/ConfigureFieldMapping/components/RequiredFieldMapping/FieldMappingsTable.tsx index 1a255ffbd..094dfc8c0 100644 --- a/public/pages/CreateDetector/components/ConfigureFieldMapping/components/RequiredFieldMapping/FieldMappingsTable.tsx +++ b/public/pages/CreateDetector/components/ConfigureFieldMapping/components/RequiredFieldMapping/FieldMappingsTable.tsx @@ -12,6 +12,7 @@ import { EuiIcon, EuiInMemoryTable, EuiText, + EuiToolTip, } from '@elastic/eui'; import { DEFAULT_EMPTY_DATA } from '../../../../../../utils/constants'; import { STATUS_ICON_PROPS } from '../../utils/constants'; @@ -140,14 +141,22 @@ export default class FieldMappingsTable extends Compo const { existingMappings: createdMappings, invalidMappingFieldNames } = this.props .mappingProps as MappingProps[MappingViewType.Edit]; let iconProps = STATUS_ICON_PROPS['unmapped']; + let iconTooltip = 'This field needs to be mapped with a field from your log source.'; if ( createdMappings[entry.ruleFieldName] && !invalidMappingFieldNames.includes(entry.ruleFieldName) ) { iconProps = STATUS_ICON_PROPS['mapped']; + iconTooltip = 'This field has been mapped.'; } - return || DEFAULT_EMPTY_DATA; + return ( + ( + + + + ) || DEFAULT_EMPTY_DATA + ); }, }); } From 2c38c779cc512c78dd2c27cd5f06c3e47b3ed88f Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Tue, 21 Feb 2023 12:42:12 +0100 Subject: [PATCH 40/48] [FEATURE] Create detector | Make data source multi-select field #419 Signed-off-by: Jovan Cvetkovic --- .../containers/DefineDetector.tsx | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx b/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx index e3f0d32cb..789a5e0eb 100644 --- a/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx @@ -58,6 +58,13 @@ export default class DefineDetector extends Component Date: Tue, 21 Feb 2023 18:31:27 +0100 Subject: [PATCH 41/48] unit tests fix Signed-off-by: Jovan Cvetkovic --- .../components/DefineDetector/containers/DefineDetector.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx b/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx index 789a5e0eb..49dded57d 100644 --- a/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx @@ -76,7 +76,6 @@ export default class DefineDetector extends Component Date: Tue, 21 Feb 2023 23:07:38 +0100 Subject: [PATCH 42/48] Code review Signed-off-by: Jovan Cvetkovic --- .../DetectorDataSource/DetectorDataSource.tsx | 78 ++++++++++++++++++- .../containers/DefineDetector.tsx | 71 ++--------------- 2 files changed, 80 insertions(+), 69 deletions(-) diff --git a/public/pages/CreateDetector/components/DefineDetector/components/DetectorDataSource/DetectorDataSource.tsx b/public/pages/CreateDetector/components/DefineDetector/components/DetectorDataSource/DetectorDataSource.tsx index 5592501cc..358b0032e 100644 --- a/public/pages/CreateDetector/components/DefineDetector/components/DetectorDataSource/DetectorDataSource.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/components/DetectorDataSource/DetectorDataSource.tsx @@ -5,20 +5,31 @@ import React, { Component } from 'react'; import { ContentPanel } from '../../../../../../components/ContentPanel'; -import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow, EuiSpacer } from '@elastic/eui'; +import { + EuiComboBox, + EuiComboBoxOptionOption, + EuiFormRow, + EuiSpacer, + EuiCallOut, + EuiTextColor, +} from '@elastic/eui'; import { FormFieldHeader } from '../../../../../../components/FormFieldHeader/FormFieldHeader'; import { IndexOption } from '../../../../../Detectors/models/interfaces'; import { MIN_NUM_DATA_SOURCES } from '../../../../../Detectors/utils/constants'; import IndexService from '../../../../../../services/IndexService'; import { NotificationsStart } from 'opensearch-dashboards/public'; import { errorNotificationToast } from '../../../../../../utils/helpers'; +import _ from 'lodash'; +import { FieldMappingService } from '../../../../../../services'; interface DetectorDataSourceProps { detectorIndices: string[]; indexService: IndexService; + filedMappingService: FieldMappingService; isEdit: boolean; onDetectorInputIndicesChange: (selectedOptions: EuiComboBoxOptionOption[]) => void; notifications: NotificationsStart; + detector_type: string; } interface DetectorDataSourceState { @@ -26,18 +37,22 @@ interface DetectorDataSourceState { fieldTouched: boolean; indexOptions: IndexOption[]; errorMessage?: string; + message: string[]; } export default class DetectorDataSource extends Component< DetectorDataSourceProps, DetectorDataSourceState > { + private indicesMappings: any = {}; + constructor(props: DetectorDataSourceProps) { super(props); this.state = { loading: true, fieldTouched: props.isEdit, indexOptions: [], + message: [], }; } @@ -82,17 +97,74 @@ export default class DetectorDataSource extends Component< this.onSelectionChange(parsedOptions); }; - onSelectionChange = (options: EuiComboBoxOptionOption[]) => { + onSelectionChange = async (options: EuiComboBoxOptionOption[]) => { + const allIndices = _.map(options, 'label'); + for (let indexName in this.indicesMappings) { + if (allIndices.indexOf(indexName) === -1) { + // cleanup removed indexes + delete this.indicesMappings[indexName]; + } + } + + for (const indexName of allIndices) { + if (!this.indicesMappings[indexName]) { + const detectorType = this.props.detector_type.toLowerCase(); + const result = await this.props.filedMappingService.getMappingsView( + indexName, + detectorType + ); + result.ok && (this.indicesMappings[indexName] = result.response.unmapped_field_aliases); + } + } + + if (!_.isEmpty(this.indicesMappings)) { + let firstMapping: string[] = []; + let firstMatchMappingIndex: string = ''; + let message: string[] = []; + for (let indexName in this.indicesMappings) { + if (this.indicesMappings.hasOwnProperty(indexName)) { + if (!firstMapping.length) firstMapping = this.indicesMappings[indexName]; + !firstMatchMappingIndex.length && (firstMatchMappingIndex = indexName); + if (!_.isEqual(firstMapping, this.indicesMappings[indexName])) { + message = [ + `The below log sources don't have the same fields, please consider creating separate detectors for them.`, + firstMatchMappingIndex, + indexName, + ]; + break; + } + } + } + + this.setState({ message }); + } + this.props.onDetectorInputIndicesChange(options); }; render() { const { detectorIndices } = this.props; - const { loading, fieldTouched, indexOptions, errorMessage } = this.state; + const { loading, fieldTouched, indexOptions, errorMessage, message } = this.state; const isInvalid = fieldTouched && detectorIndices.length < MIN_NUM_DATA_SOURCES; return ( + {message.length ? ( + <> + + {message.map((messageItem: string, index: number) => ( + + {messageItem} +
+
+ ))} +
+ + + ) : null} diff --git a/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx b/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx index 49dded57d..86f5ccae8 100644 --- a/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx @@ -5,7 +5,7 @@ import React, { Component } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { EuiSpacer, EuiTitle, EuiText, EuiCallOut, EuiTextColor } from '@elastic/eui'; +import { EuiSpacer, EuiTitle, EuiText } from '@elastic/eui'; import { Detector, PeriodSchedule } from '../../../../../../models/interfaces'; import DetectorBasicDetailsForm from '../components/DetectorDetails'; import DetectorDataSource from '../components/DetectorDataSource'; @@ -43,61 +43,14 @@ interface DefineDetectorState { } export default class DefineDetector extends Component { - state = { - message: [], - }; - - private indicesMappings: any = {}; - async updateDetectorCreationState(detector: Detector) { let isDataValid = !!detector.name && !!detector.detector_type && detector.inputs[0].detector_input.indices.length >= MIN_NUM_DATA_SOURCES && !!detector.schedule.period.interval; - this.props.changeDetector(detector); - - const allIndices = detector.inputs[0].detector_input.indices; - for (let indexName in this.indicesMappings) { - if (allIndices.indexOf(indexName) === -1) { - // cleanup removed indexes - delete this.indicesMappings[indexName]; - } - } - - for (const indexName of allIndices) { - if (!this.indicesMappings[indexName]) { - const detectorType = this.props.detector.detector_type.toLowerCase(); - const result = await this.props.filedMappingService.getMappingsView( - indexName, - detectorType - ); - result.ok && (this.indicesMappings[indexName] = result.response.unmapped_field_aliases); - } - } - - if (!_.isEmpty(this.indicesMappings)) { - let firstMapping: string[] = []; - let firstMatchMappingIndex: string = ''; - let message: string[] = []; - for (let indexName in this.indicesMappings) { - if (this.indicesMappings.hasOwnProperty(indexName)) { - if (!firstMapping.length) firstMapping = this.indicesMappings[indexName]; - !firstMatchMappingIndex.length && (firstMatchMappingIndex = indexName); - if (!_.isEqual(firstMapping, this.indicesMappings[indexName])) { - message = [ - `The below log sources don't have the same fields, please consider creating separate detectors for them.`, - firstMatchMappingIndex, - indexName, - ]; - break; - } - } - } - - this.setState({ message }); - } + this.props.changeDetector(detector); this.props.updateDataValidState(DetectorCreationStep.DEFINE_DETECTOR, isDataValid); } @@ -213,8 +166,8 @@ export default class DefineDetector extends Component - {message.length ? ( - <> - - {message.map((messageItem: string, index: number) => ( - - {messageItem} -
-
- ))} -
- - - ) : null} From e846f2be750f28ec553dec4d3629dcdb4a8a3fa3 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Tue, 21 Feb 2023 23:53:39 +0100 Subject: [PATCH 43/48] Code review Signed-off-by: Jovan Cvetkovic --- .../FieldMappingsTable.tsx | 4 +- .../containers/ConfigureFieldMapping.tsx | 59 ++++++++++--------- .../EditFieldMappings.test.tsx.snap | 22 +++---- 3 files changed, 44 insertions(+), 41 deletions(-) diff --git a/public/pages/CreateDetector/components/ConfigureFieldMapping/components/RequiredFieldMapping/FieldMappingsTable.tsx b/public/pages/CreateDetector/components/ConfigureFieldMapping/components/RequiredFieldMapping/FieldMappingsTable.tsx index 094dfc8c0..fbe5feee7 100644 --- a/public/pages/CreateDetector/components/ConfigureFieldMapping/components/RequiredFieldMapping/FieldMappingsTable.tsx +++ b/public/pages/CreateDetector/components/ConfigureFieldMapping/components/RequiredFieldMapping/FieldMappingsTable.tsx @@ -86,7 +86,7 @@ export default class FieldMappingsTable extends Compo const columns: EuiBasicTableColumn[] = [ { field: 'ruleFieldName', - name: 'Rule field name', + name: 'Detector field name', dataType: 'string', width: '25%', render: (ruleFieldName: string) => ruleFieldName || DEFAULT_EMPTY_DATA, @@ -100,7 +100,7 @@ export default class FieldMappingsTable extends Compo }, { field: 'logFieldName', - name: 'Log field name', + name: 'Log source field name', dataType: 'string', width: '45%', render: (logFieldName: string, entry: FieldMappingsTableItem) => { diff --git a/public/pages/CreateDetector/components/ConfigureFieldMapping/containers/ConfigureFieldMapping.tsx b/public/pages/CreateDetector/components/ConfigureFieldMapping/containers/ConfigureFieldMapping.tsx index 281225cd1..fc7e4023d 100644 --- a/public/pages/CreateDetector/components/ConfigureFieldMapping/containers/ConfigureFieldMapping.tsx +++ b/public/pages/CreateDetector/components/ConfigureFieldMapping/containers/ConfigureFieldMapping.tsx @@ -180,6 +180,37 @@ export default class ConfigureFieldMapping extends Component< + + + +

{`Automatically mapped fields (${mappedRuleFields.length})`}

+
+
+ } + buttonProps={{ style: { paddingLeft: '10px', paddingRight: '10px' } }} + id={'mappedFieldsAccordion'} + initialIsOpen={false} + > + + + {...this.props} + loading={loading} + ruleFields={mappedRuleFields} + indexFields={indexFieldOptions} + mappingProps={{ + type: MappingViewType.Edit, + existingMappings, + invalidMappingFieldNames, + onMappingCreation: this.onMappingCreation, + }} + /> + +
+ + + {unmappedRuleFields.length > 0 ? ( <> {pendingCount > 0 ? ( @@ -227,34 +258,6 @@ export default class ConfigureFieldMapping extends Component< )} - - - -

{`Default mapped fields (${mappedRuleFields.length})`}

-
-
- } - buttonProps={{ style: { paddingLeft: '10px', paddingRight: '10px' } }} - id={'mappedFieldsAccordion'} - initialIsOpen={false} - > - - - {...this.props} - loading={loading} - ruleFields={mappedRuleFields} - indexFields={indexFieldOptions} - mappingProps={{ - type: MappingViewType.Edit, - existingMappings, - invalidMappingFieldNames, - onMappingCreation: this.onMappingCreation, - }} - /> - -
); diff --git a/public/pages/Detectors/containers/FieldMappings/__snapshots__/EditFieldMappings.test.tsx.snap b/public/pages/Detectors/containers/FieldMappings/__snapshots__/EditFieldMappings.test.tsx.snap index f012c34ef..7ee24bce6 100644 --- a/public/pages/Detectors/containers/FieldMappings/__snapshots__/EditFieldMappings.test.tsx.snap +++ b/public/pages/Detectors/containers/FieldMappings/__snapshots__/EditFieldMappings.test.tsx.snap @@ -492,7 +492,7 @@ exports[` spec renders the component 1`] = ` Object { "dataType": "string", "field": "ruleFieldName", - "name": "Rule field name", + "name": "Detector field name", "render": [Function], "width": "25%", }, @@ -506,7 +506,7 @@ exports[` spec renders the component 1`] = ` Object { "dataType": "string", "field": "logFieldName", - "name": "Log field name", + "name": "Log source field name", "render": [Function], "width": "45%", }, @@ -563,7 +563,7 @@ exports[` spec renders the component 1`] = ` Object { "dataType": "string", "field": "ruleFieldName", - "name": "Rule field name", + "name": "Detector field name", "render": [Function], "width": "25%", }, @@ -577,7 +577,7 @@ exports[` spec renders the component 1`] = ` Object { "dataType": "string", "field": "logFieldName", - "name": "Log field name", + "name": "Log source field name", "render": [Function], "width": "45%", }, @@ -631,7 +631,7 @@ exports[` spec renders the component 1`] = ` "allowNeutralSort": true, "sort": Object { "direction": "asc", - "field": "Rule field name", + "field": "Detector field name", }, } } @@ -824,15 +824,15 @@ exports[` spec renders the component 1`] = ` values={ Object { "description": undefined, - "innerText": "Rule field name", + "innerText": "Detector field name", } } > - Rule field name + Detector field name @@ -918,15 +918,15 @@ exports[` spec renders the component 1`] = ` values={ Object { "description": undefined, - "innerText": "Log field name", + "innerText": "Log source field name", } } > - Log field name + Log source field name From 964c560c6920c5f38ad94cd8e7d437f3bd626059 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Wed, 22 Feb 2023 00:01:32 +0100 Subject: [PATCH 44/48] Code review Signed-off-by: Jovan Cvetkovic --- .../components/DefineDetector/containers/DefineDetector.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx b/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx index 3fb41a615..16e3e9bf1 100644 --- a/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/containers/DefineDetector.tsx @@ -194,6 +194,7 @@ export default class DefineDetector extends Component Date: Wed, 22 Feb 2023 00:41:16 +0100 Subject: [PATCH 45/48] Code review Signed-off-by: Jovan Cvetkovic --- .../FieldMappings/EditFieldMapping.tsx | 73 +++++++++++++------ .../EditFieldMappings.test.tsx.snap | 11 ++- 2 files changed, 58 insertions(+), 26 deletions(-) diff --git a/public/pages/Detectors/containers/FieldMappings/EditFieldMapping.tsx b/public/pages/Detectors/containers/FieldMappings/EditFieldMapping.tsx index d66643258..03944e0f8 100644 --- a/public/pages/Detectors/containers/FieldMappings/EditFieldMapping.tsx +++ b/public/pages/Detectors/containers/FieldMappings/EditFieldMapping.tsx @@ -5,7 +5,14 @@ import React, { Component } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { EuiAccordion, EuiHorizontalRule, EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui'; +import { + EuiAccordion, + EuiHorizontalRule, + EuiPanel, + EuiSpacer, + EuiTitle, + EuiCallOut, +} from '@elastic/eui'; import FieldMappingsTable from '../../../CreateDetector/components/ConfigureFieldMapping/components/RequiredFieldMapping'; import { ContentPanel } from '../../../../components/ContentPanel'; import { Detector, FieldMapping } from '../../../../../models/interfaces'; @@ -158,34 +165,12 @@ export default class EditFieldMappings extends Component< return (
- {unmappedRuleFields.length > 0 && ( - <> - - - {...this.props} - loading={loading} - ruleFields={unmappedRuleFields} - indexFields={logFieldOptions} - mappingProps={{ - type: MappingViewType.Edit, - existingMappings, - invalidMappingFieldNames, - onMappingCreation: this.onMappingCreation, - }} - /> - - - - )} -

{`Mapped fields (${mappedRuleFields.length})`}

+

{`Automatically mapped fields (${mappedRuleFields.length})`}

} @@ -208,6 +193,46 @@ export default class EditFieldMappings extends Component< /> + + + + {unmappedRuleFields.length > 0 && ( + <> + {unmappedRuleFields.length > 0 ? ( + +

+ To generate accurate findings, we recommend mapping the following security rules + fields with the log fields in your data source. +

+
+ ) : ( + +

Your data source have been mapped with all security rule fields.

+
+ )} + + + + + {...this.props} + loading={loading} + ruleFields={unmappedRuleFields} + indexFields={logFieldOptions} + mappingProps={{ + type: MappingViewType.Edit, + existingMappings, + invalidMappingFieldNames, + onMappingCreation: this.onMappingCreation, + }} + /> + + + + )} +
); diff --git a/public/pages/Detectors/containers/FieldMappings/__snapshots__/EditFieldMappings.test.tsx.snap b/public/pages/Detectors/containers/FieldMappings/__snapshots__/EditFieldMappings.test.tsx.snap index 7ee24bce6..9bd7ee5b8 100644 --- a/public/pages/Detectors/containers/FieldMappings/__snapshots__/EditFieldMappings.test.tsx.snap +++ b/public/pages/Detectors/containers/FieldMappings/__snapshots__/EditFieldMappings.test.tsx.snap @@ -201,7 +201,7 @@ exports[` spec renders the component 1`] = ` >

- Mapped fields (0) + Automatically mapped fields (0)

@@ -261,7 +261,7 @@ exports[` spec renders the component 1`] = `

- Mapped fields (0) + Automatically mapped fields (0)

@@ -1099,6 +1099,13 @@ exports[` spec renders the component 1`] = ` className="euiSpacer euiSpacer--m" /> + +
+
`; From 54022199682582c6caae1ea96e537ad0c41193ee Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Wed, 22 Feb 2023 01:48:49 +0100 Subject: [PATCH 46/48] Code review Signed-off-by: Jovan Cvetkovic --- .../DetectorDataSource/DetectorDataSource.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/public/pages/CreateDetector/components/DefineDetector/components/DetectorDataSource/DetectorDataSource.tsx b/public/pages/CreateDetector/components/DefineDetector/components/DetectorDataSource/DetectorDataSource.tsx index 358b0032e..1f19fba0a 100644 --- a/public/pages/CreateDetector/components/DefineDetector/components/DetectorDataSource/DetectorDataSource.tsx +++ b/public/pages/CreateDetector/components/DefineDetector/components/DetectorDataSource/DetectorDataSource.tsx @@ -127,7 +127,7 @@ export default class DetectorDataSource extends Component< !firstMatchMappingIndex.length && (firstMatchMappingIndex = indexName); if (!_.isEqual(firstMapping, this.indicesMappings[indexName])) { message = [ - `The below log sources don't have the same fields, please consider creating separate detectors for them.`, + `We recommend creating separate detectors for each of the following log sources:`, firstMatchMappingIndex, indexName, ]; @@ -151,12 +151,13 @@ export default class DetectorDataSource extends Component< {message.length ? ( <> - + {message.map((messageItem: string, index: number) => ( - + + {index === 0 ? '' : 'ㅤ•ㅤ'} {messageItem}
From 9cfa754403c05e26ddcfbb2c6d65eceef393d677 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Wed, 22 Feb 2023 02:36:21 +0100 Subject: [PATCH 47/48] Code review Signed-off-by: Jovan Cvetkovic --- cypress/integration/1_detectors.spec.js | 35 +++++++++---------- .../UpdateBasicDetails/UpdateBasicDetails.tsx | 2 ++ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/cypress/integration/1_detectors.spec.js b/cypress/integration/1_detectors.spec.js index 871941c82..252adbde2 100644 --- a/cypress/integration/1_detectors.spec.js +++ b/cypress/integration/1_detectors.spec.js @@ -20,14 +20,17 @@ const testMappings = { const cypressDNSRule = dns_rule_data.title; describe('Detectors', () => { - const indexName = 'cypress-test-dns'; + const cypressIndexDns = 'cypress-index-dns'; + const cypressIndexWindows = 'cypress-index-windows'; const detectorName = 'test detector'; before(() => { cy.cleanUpTests(); + cy.createIndex(cypressIndexWindows, sample_index_settings); + // Create test index - cy.createIndex(indexName, sample_index_settings).then(() => + cy.createIndex(cypressIndexDns, sample_index_settings).then(() => cy .request('POST', '_plugins/_security_analytics/rules/_search?prePackaged=true', { from: 0, @@ -58,11 +61,6 @@ describe('Detectors', () => { }); it('...should show mappings warning', () => { - const indexName = 'cypress-index-windows'; - const dnsName = 'cypress-index-dns'; - cy.createIndex(indexName, sample_index_settings); - cy.createIndex(dnsName, sample_dns_settings); - // Locate Create detector button click to start cy.get('.euiButton').filter(':contains("Create detector")').click({ force: true }); @@ -71,23 +69,25 @@ describe('Detectors', () => { contains: 'Define detector', }); - // Select our pre-seeded data source (check indexName) + // Select our pre-seeded data source (check cypressIndexDns) cy.get(`[data-test-subj="define-detector-select-data-source"]`) .find('input') .focus() - .realType(indexName); + .realType(cypressIndexDns); // Select threat detector type (Windows logs) cy.get(`input[id="dns"]`).click({ force: true }); - // Select our pre-seeded data source (check indexName) + // Select our pre-seeded data source (check cypressIndexDns) cy.get(`[data-test-subj="define-detector-select-data-source"]`) .find('input') .focus() - .realType(dnsName) + .realType(cypressIndexWindows) .realPress('Enter'); - cy.get('.euiCallOut').should('be.visible').contains('Detector configuration warning'); + cy.get('.euiCallOut') + .should('be.visible') + .contains('The selected log sources contain different types of logs'); }); it('...can be created', () => { @@ -102,11 +102,11 @@ describe('Detectors', () => { // Enter a name for the detector in the appropriate input cy.get(`input[placeholder="Enter a name for the detector."]`).focus().realType('test detector'); - // Select our pre-seeded data source (check indexName) + // Select our pre-seeded data source (check cypressIndexDns) cy.get(`[data-test-subj="define-detector-select-data-source"]`) .find('input') .focus() - .realType(indexName); + .realType(cypressIndexDns); cy.intercept({ pathname: '/_plugins/_security_analytics/rules/_search', @@ -198,7 +198,7 @@ describe('Detectors', () => { cy.contains('Detector details'); cy.contains(detectorName); cy.contains('dns'); - cy.contains(indexName); + cy.contains(cypressIndexDns); cy.contains('Alert on test_trigger'); // Create the detector @@ -252,8 +252,7 @@ describe('Detectors', () => { .find('input') .ospClear() .focus() - .realType('.opensearch-notifications-config') - .realPress('Enter'); + .realType(cypressIndexWindows); // Change detector scheduling cy.get(`[data-test-subj="detector-schedule-number-select"]`).ospClear().focus().realType('10'); @@ -271,7 +270,7 @@ describe('Detectors', () => { cy.contains('test detector edited'); cy.contains('Every 10 hours'); cy.contains('Edited description'); - cy.contains('.opensearch-notifications-config'); + cy.contains(cypressIndexWindows); }); it('...rules can be edited', () => { diff --git a/public/pages/Detectors/components/UpdateBasicDetails/UpdateBasicDetails.tsx b/public/pages/Detectors/components/UpdateBasicDetails/UpdateBasicDetails.tsx index ad8fed8c4..edd77e191 100644 --- a/public/pages/Detectors/components/UpdateBasicDetails/UpdateBasicDetails.tsx +++ b/public/pages/Detectors/components/UpdateBasicDetails/UpdateBasicDetails.tsx @@ -217,9 +217,11 @@ export const UpdateDetectorBasicDetails: React.FC From ee2075ea48c7d4ca6a9c27a74bb34422aa4f7170 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Wed, 22 Feb 2023 03:23:47 +0100 Subject: [PATCH 48/48] snapshot fix Signed-off-by: Jovan Cvetkovic --- .../__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap | 1 + 1 file changed, 1 insertion(+) diff --git a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap index 5e033074f..e375ee4ae 100644 --- a/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap +++ b/public/pages/Detectors/components/UpdateBasicDetails/__snapshots__/UpdateDetectorBasicDetails.test.tsx.snap @@ -887,6 +887,7 @@ exports[` spec renders the component 1`] = ` ".windows", ] } + detector_type="detector_type" indexService={ Object { "getIndices": [Function],