Skip to content

Commit

Permalink
Mohr security solutions jest configs :sadpanda:
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
  • Loading branch information
Tyler Smalley committed Nov 3, 2021
1 parent a99fefc commit ea0c946
Show file tree
Hide file tree
Showing 61 changed files with 411 additions and 59 deletions.
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ module.exports = {
'<rootDir>/test/*/jest.config.js',
'<rootDir>/x-pack/plugins/*/jest.config.js',
'<rootDir>/x-pack/plugins/security_solution/*/jest.config.js',
'<rootDir>/x-pack/plugins/security_solution/public/*/jest.config.js',
'<rootDir>/x-pack/plugins/security_solution/server/*/jest.config.js',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { toMountPoint } from '../../../../../../../src/plugins/kibana_react/publ
import { MlPopover } from '../../../common/components/ml_popover/ml_popover';
import { useKibana } from '../../../common/lib/kibana';
import { ADD_DATA_PATH } from '../../../../common/constants';
import { isDetectionsPath } from '../../../../public/helpers';
import { isDetectionsPath } from '../../../../public/common/helpers';

const BUTTON_ADD_DATA = i18n.translate('xpack.securitySolution.globalHeader.buttonAddData', {
defaultMessage: 'Add integrations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/plugins/security_solution/server'],
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/plugins/security_solution/public/app'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server',
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/app',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/**/*.{ts,tsx}'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/app/**/*.{ts,tsx}'],
};
16 changes: 16 additions & 0 deletions x-pack/plugins/security_solution/public/cases/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/plugins/security_solution/public/cases'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/cases',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/cases/**/*.{ts,tsx}'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
MatrixHistogramTypeToAggName,
} from '../../../../common/search_strategy/security_solution';
import { isErrorResponse, isCompleteResponse } from '../../../../../../../src/plugins/data/common';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { InspectResponse } from '../../../types';
import * as i18n from './translations';
import { useTransforms } from '../../../transforms/containers/use_transforms';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
*/
import React from 'react';
import { shallow } from 'enzyme';
import { Capabilities } from '../../../../src/core/public';
import { CASES_FEATURE_ID, SERVER_APP_ID } from '../common/constants';
import { Capabilities } from '../../../../../src/core/public';
import { CASES_FEATURE_ID, SERVER_APP_ID } from '../../common/constants';
import {
parseRoute,
getHostRiskIndex,
isSubPluginAvailable,
getSubPluginRoutesByCapabilities,
RedirectRoute,
} from './helpers';
import { StartedSubPlugins } from './types';
import { StartedSubPlugins } from '../types';

describe('public helpers parseRoute', () => {
it('should properly parse hash route', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isEmpty } from 'lodash/fp';
import React from 'react';
import { matchPath, RouteProps, Redirect } from 'react-router-dom';

import { Capabilities, CoreStart } from '../../../../src/core/public';
import { Capabilities, CoreStart } from '../../../../../src/core/public';
import {
ALERTS_PATH,
APP_UI_ID,
Expand All @@ -21,15 +21,15 @@ import {
CASES_FEATURE_ID,
OVERVIEW_PATH,
CASES_PATH,
} from '../common/constants';
} from '../../common/constants';
import {
FactoryQueryTypes,
StrategyResponseType,
} from '../common/search_strategy/security_solution';
import { TimelineEqlResponse } from '../common/search_strategy/timeline';
import { NoPrivilegesPage } from './app/no_privileges';
import { SecurityPageName } from './app/types';
import { CASES_SUB_PLUGIN_KEY, InspectResponse, StartedSubPlugins } from './types';
} from '../../common/search_strategy/security_solution';
import { TimelineEqlResponse } from '../../common/search_strategy/timeline';
import { NoPrivilegesPage } from '../app/no_privileges';
import { SecurityPageName } from '../app/types';
import { CASES_SUB_PLUGIN_KEY, InspectResponse, StartedSubPlugins } from '../types';

export const parseRoute = (location: Pick<Location, 'hash' | 'pathname' | 'search'>) => {
if (!isEmpty(location.hash)) {
Expand Down
16 changes: 16 additions & 0 deletions x-pack/plugins/security_solution/public/common/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/plugins/security_solution/public/common'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/common',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/common/**/*.{ts,tsx}'],
};
18 changes: 18 additions & 0 deletions x-pack/plugins/security_solution/public/detections/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/plugins/security_solution/public/detections'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/detections',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/x-pack/plugins/security_solution/public/detections/**/*.{ts,tsx}',
],
};
18 changes: 18 additions & 0 deletions x-pack/plugins/security_solution/public/exceptions/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/plugins/security_solution/public/exceptions'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/exceptions',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/x-pack/plugins/security_solution/public/exceptions/**/*.{ts,tsx}',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { inputsModel } from '../../../common/store';
import { createFilter } from '../../../common/containers/helpers';
import { generateTablePaginationOptions } from '../../../common/components/paginated_table/helpers';
import { useKibana } from '../../../common/lib/kibana';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { InspectResponse } from '../../../types';

import { hostsModel, hostsSelectors } from '../../store';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
isCompleteResponse,
isErrorResponse,
} from '../../../../../../../../src/plugins/data/common';
import { getInspectResponse } from '../../../../helpers';
import { getInspectResponse } from '../../../../common/helpers';
import { InspectResponse } from '../../../../types';

export const ID = 'hostsDetailsQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { ESTermQuery } from '../../../../common/typed_json';

import * as i18n from './translations';
import { isCompleteResponse, isErrorResponse } from '../../../../../../../src/plugins/data/common';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { InspectResponse } from '../../../types';
import { useTransforms } from '../../../transforms/containers/use_transforms';
import { useAppToasts } from '../../../common/hooks/use_app_toasts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import { ESTermQuery } from '../../../../../common/typed_json';

import * as i18n from './translations';
import { getInspectResponse } from '../../../../helpers';
import { getInspectResponse } from '../../../../common/helpers';
import { InspectResponse } from '../../../../types';

const ID = 'hostsKpiAuthenticationsQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import { ESTermQuery } from '../../../../../common/typed_json';

import * as i18n from './translations';
import { getInspectResponse } from '../../../../helpers';
import { getInspectResponse } from '../../../../common/helpers';
import { InspectResponse } from '../../../../types';

const ID = 'hostsKpiHostsQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import { ESTermQuery } from '../../../../../common/typed_json';

import * as i18n from './translations';
import { getInspectResponse } from '../../../../helpers';
import { getInspectResponse } from '../../../../common/helpers';
import { InspectResponse } from '../../../../types';

const ID = 'hostsKpiUniqueIpsQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {

import * as i18n from './translations';
import { ESTermQuery } from '../../../../common/typed_json';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { InspectResponse } from '../../../types';
import { useDeepEqualSelector } from '../../../common/hooks/use_selector';
import { useAppToasts } from '../../../common/hooks/use_app_toasts';
Expand Down
16 changes: 16 additions & 0 deletions x-pack/plugins/security_solution/public/hosts/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/plugins/security_solution/public/hosts'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/hosts',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/hosts/**/*.{ts,tsx}'],
};
8 changes: 4 additions & 4 deletions x-pack/plugins/security_solution/public/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/plugins/security_solution/public'],
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/plugins/security_solution/public/app'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public',
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/app',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/**/*.{ts,tsx}'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/app/**/*.{ts,tsx}'],
};
18 changes: 18 additions & 0 deletions x-pack/plugins/security_solution/public/management/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/plugins/security_solution/public/management'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/management',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/x-pack/plugins/security_solution/public/management/**/*.{ts,tsx}',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from '../../../../common/search_strategy';
import { isCompleteResponse, isErrorResponse } from '../../../../../../../src/plugins/data/common';
import * as i18n from './translations';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { InspectResponse } from '../../../types';
import { useAppToasts } from '../../../common/hooks/use_app_toasts';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
isCompleteResponse,
isErrorResponse,
} from '../../../../../../../../src/plugins/data/common';
import { getInspectResponse } from '../../../../helpers';
import { getInspectResponse } from '../../../../common/helpers';
import { InspectResponse } from '../../../../types';

const ID = 'networkKpiDnsQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
isCompleteResponse,
isErrorResponse,
} from '../../../../../../../../src/plugins/data/common';
import { getInspectResponse } from '../../../../helpers';
import { getInspectResponse } from '../../../../common/helpers';
import { InspectResponse } from '../../../../types';

const ID = 'networkKpiNetworkEventsQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
isCompleteResponse,
isErrorResponse,
} from '../../../../../../../../src/plugins/data/common';
import { getInspectResponse } from '../../../../helpers';
import { getInspectResponse } from '../../../../common/helpers';
import { InspectResponse } from '../../../../types';

const ID = 'networkKpiTlsHandshakesQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
isCompleteResponse,
isErrorResponse,
} from '../../../../../../../../src/plugins/data/common';
import { getInspectResponse } from '../../../../helpers';
import { getInspectResponse } from '../../../../common/helpers';
import { InspectResponse } from '../../../../types';

const ID = 'networkKpiUniqueFlowsQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
isCompleteResponse,
isErrorResponse,
} from '../../../../../../../../src/plugins/data/common';
import { getInspectResponse } from '../../../../helpers';
import { getInspectResponse } from '../../../../common/helpers';
import { InspectResponse } from '../../../../types';

const ID = 'networkKpiUniquePrivateIpsQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from '../../../../common/search_strategy';
import { isCompleteResponse, isErrorResponse } from '../../../../../../../src/plugins/data/common';
import * as i18n from './translations';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { InspectResponse } from '../../../types';
import { useAppToasts } from '../../../common/hooks/use_app_toasts';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
import { isCompleteResponse, isErrorResponse } from '../../../../../../../src/plugins/data/common';
import * as i18n from './translations';
import { InspectResponse } from '../../../types';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { useAppToasts } from '../../../common/hooks/use_app_toasts';

const ID = 'networkHttpQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
PageInfoPaginated,
} from '../../../../common/search_strategy';
import { isCompleteResponse, isErrorResponse } from '../../../../../../../src/plugins/data/common';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { InspectResponse } from '../../../types';
import * as i18n from './translations';
import { useTransforms } from '../../../transforms/containers/use_transforms';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
PageInfoPaginated,
} from '../../../../common/search_strategy';
import { isCompleteResponse, isErrorResponse } from '../../../../../../../src/plugins/data/common';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { InspectResponse } from '../../../types';
import * as i18n from './translations';
import { useTransforms } from '../../../transforms/containers/use_transforms';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
import { isCompleteResponse, isErrorResponse } from '../../../../../../../src/plugins/data/common';

import * as i18n from './translations';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { FlowTargetSourceDest, PageInfoPaginated } from '../../../../common/search_strategy';
import { useAppToasts } from '../../../common/hooks/use_app_toasts';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from '../../../../common/search_strategy/security_solution/network';
import { isCompleteResponse, isErrorResponse } from '../../../../../../../src/plugins/data/common';
import * as i18n from './translations';
import { getInspectResponse } from '../../../helpers';
import { getInspectResponse } from '../../../common/helpers';
import { InspectResponse } from '../../../types';
import { PageInfoPaginated } from '../../../../common/search_strategy';
import { useAppToasts } from '../../../common/hooks/use_app_toasts';
Expand Down
Loading

0 comments on commit ea0c946

Please sign in to comment.