[presUtils/fleet] stop importing test helpers in bundles (#148825)

This PR stops importing:
- `functionWrapper` and `fontStyle` test helpers in
`@kbn/presentation-util-plugin/common`
 - `createFleetAuthzMock` test helper in `@kbn/fleet-plugin/common`

These are instead imported from a `*/mocks` or `*/test_helpers` import
target and the related `eslint-disable` comments were removed.

While working through some changes to the package system I fixed a bug
in the source classifier which made these issues clear and made a fix
required. The changes have been broken out of my massive PR to make
review simpler.
This commit is contained in:
Spencer 2023-01-12 16:11:30 -06:00 committed by GitHub
parent 4975a766f6
commit ffeb61a75f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
71 changed files with 112 additions and 110 deletions

View file

@ -141,9 +141,9 @@ module.exports = {
/**
* ESLint rule to aid with breaking up packages:
*
* `fromPacakge` the package name which was broken up
* `toPackage` the package where the removed exports were placed
* `exportNames` the list of exports which used to be found in `fromPacakge` and are now found in `toPackage`
* `from` the package/request where the exports used to be
* `to` the package/request where the exports are now
* `exportNames` the list of exports which used to be found in `from` and are now found in `to`
*
* TODO(@spalger): once packages have types we should be able to filter this rule based on the package type
* of the file being linted so that we could re-route imports from `plugin-client` types to a different package
@ -151,8 +151,8 @@ module.exports = {
*/
'@kbn/imports/exports_moved_packages': ['error', [
{
fromPackage: '@kbn/dev-utils',
toPackage: '@kbn/tooling-log',
from: '@kbn/dev-utils',
to: '@kbn/tooling-log',
exportNames: [
'DEFAULT_LOG_LEVEL',
'getLogLevelFlagsHelp',
@ -171,8 +171,8 @@ module.exports = {
]
},
{
fromPackage: '@kbn/dev-utils',
toPackage: '@kbn/ci-stats-reporter',
from: '@kbn/dev-utils',
to: '@kbn/ci-stats-reporter',
exportNames: [
'CiStatsMetric',
'CiStatsReporter',
@ -188,15 +188,15 @@ module.exports = {
]
},
{
fromPackage: '@kbn/dev-utils',
toPackage: '@kbn/ci-stats-core',
from: '@kbn/dev-utils',
to: '@kbn/ci-stats-core',
exportNames: [
'Config',
]
},
{
fromPackage: '@kbn/dev-utils',
toPackage: '@kbn/jest-serializers',
from: '@kbn/dev-utils',
to: '@kbn/jest-serializers',
exportNames: [
'createAbsolutePathSerializer',
'createStripAnsiSerializer',
@ -206,23 +206,23 @@ module.exports = {
]
},
{
fromPackage: '@kbn/dev-utils',
toPackage: '@kbn/stdio-dev-helpers',
from: '@kbn/dev-utils',
to: '@kbn/stdio-dev-helpers',
exportNames: [
'observeReadable',
'observeLines',
]
},
{
fromPackage: '@kbn/dev-utils',
toPackage: '@kbn/sort-package-json',
from: '@kbn/dev-utils',
to: '@kbn/sort-package-json',
exportNames: [
'sortPackageJson',
]
},
{
fromPackage: '@kbn/dev-utils',
toPackage: '@kbn/dev-cli-runner',
from: '@kbn/dev-utils',
to: '@kbn/dev-cli-runner',
exportNames: [
'run',
'Command',
@ -242,8 +242,8 @@ module.exports = {
]
},
{
fromPackage: '@kbn/dev-utils',
toPackage: '@kbn/dev-cli-errors',
from: '@kbn/dev-utils',
to: '@kbn/dev-cli-errors',
exportNames: [
'createFailError',
'createFlagError',
@ -251,16 +251,16 @@ module.exports = {
]
},
{
fromPackage: '@kbn/dev-utils',
toPackage: '@kbn/dev-proc-runner',
from: '@kbn/dev-utils',
to: '@kbn/dev-proc-runner',
exportNames: [
'withProcRunner',
'ProcRunner',
]
},
{
fromPackage: '@kbn/utils',
toPackage: '@kbn/repo-info',
from: '@kbn/utils',
to: '@kbn/repo-info',
exportNames: [
'REPO_ROOT',
'UPSTREAM_BRANCH',
@ -269,6 +269,21 @@ module.exports = {
'fromRoot',
]
},
{
from: '@kbn/presentation-util-plugin/common',
to: '@kbn/presentation-util-plugin/test_helpers',
exportNames: [
'functionWrapper',
'fontStyle'
]
},
{
from: '@kbn/fleet-plugin/common',
to: '@kbn/fleet-plugin/common/mocks',
exportNames: [
'createFleetAuthzMock'
]
}
]],
'@kbn/disable/no_protected_eslint_disable': 'error',

View file

@ -14,7 +14,7 @@ import { RUNNING_IN_EDITOR } from './helpers/running_in_editor';
let importResolverCache: ImportResolver | undefined;
/**
* Create a request resolver for ESLint, requires a PluginPackageResolver from @kbn/bazel-packages which will
* Create a request resolver for ESLint, requires a PluginPackageResolver from @kbn/repo-packages which will
* be created and cached on contextServices automatically.
*
* All import requests in the repository should return a result, if they don't it's a bug

View file

@ -16,8 +16,8 @@ const OPTIONS: MovedExportsRule[][] = [
[
{
exportNames: ['foo', 'bar'],
fromPackage: 'old',
toPackage: 'new',
from: 'old',
to: 'new',
},
],
];

View file

@ -13,8 +13,8 @@ import { TSESTree } from '@typescript-eslint/typescript-estree';
import { visitAllImportStatements, Importer } from '../helpers/visit_all_import_statements';
export interface MovedExportsRule {
fromPackage: string;
toPackage: string;
from: string;
to: string;
exportNames: string[];
}
@ -71,7 +71,7 @@ function getBadImports(imported: Imported[], rules: MovedExportsRule[]): BadImpo
node: i.node,
id: i.id,
name: i.name,
newPkg: match.toPackage,
newPkg: match.to,
};
});
}
@ -203,10 +203,10 @@ export const ExportsMovedPackagesRule: Rule.RuleModule = {
items: {
type: 'object',
properties: {
fromPackage: {
from: {
type: 'string',
},
toPackage: {
to: {
type: 'string',
},
exportNames: {
@ -268,7 +268,7 @@ export const ExportsMovedPackagesRule: Rule.RuleModule = {
return;
}
const rulesForRightPackage = rules.filter((m) => m.fromPackage === req);
const rulesForRightPackage = rules.filter((m) => m.from === req);
if (!rulesForRightPackage.length) {
return;
}

View file

@ -8,11 +8,8 @@
import expect from '@kbn/expect';
import { ExecutionContext } from '@kbn/expressions-plugin/common';
import {
functionWrapper,
getElasticLogo,
getElasticOutline,
} from '@kbn/presentation-util-plugin/common';
import { getElasticLogo, getElasticOutline } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { imageFunction as image } from './image_function';
describe('image', () => {

View file

@ -7,7 +7,7 @@
*/
import { ExecutionContext } from '@kbn/expressions-plugin/common';
import { functionWrapper, fontStyle } from '@kbn/presentation-util-plugin/common';
import { functionWrapper, fontStyle } from '@kbn/presentation-util-plugin/test_helpers';
import { metricFunction } from './metric_function';
describe('metric', () => {

View file

@ -7,11 +7,8 @@
*/
import { ExecutionContext } from '@kbn/expressions-plugin/common';
import {
getElasticLogo,
getElasticOutline,
functionWrapper,
} from '@kbn/presentation-util-plugin/common';
import { getElasticLogo, getElasticOutline } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { repeatImageFunction } from './repeat_image_function';
describe('repeatImage', () => {

View file

@ -6,11 +6,8 @@
* Side Public License, v 1.
*/
import {
functionWrapper,
getElasticOutline,
getElasticLogo,
} from '@kbn/presentation-util-plugin/common';
import { getElasticOutline, getElasticLogo } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { revealImageFunction, errors } from './reveal_image_function';
import { Origin } from '../types';
import { ExecutionContext } from '@kbn/expressions-plugin/common';

View file

@ -7,7 +7,7 @@
*/
import { ExecutionContext } from '@kbn/expressions-plugin/common';
import { functionWrapper, fontStyle } from '@kbn/presentation-util-plugin/common';
import { functionWrapper, fontStyle } from '@kbn/presentation-util-plugin/test_helpers';
import { progressFunction, errors } from './progress_function';
describe('progress', () => {

View file

@ -37,8 +37,6 @@ export {
export {
defaultTheme$,
getElasticLogo,
fontStyle,
functionWrapper,
getElasticOutline,
isValidUrl,
resolveWithMissingImage,

View file

@ -7,5 +7,3 @@
*/
export * from './utils';
// eslint-disable-next-line @kbn/imports/no_boundary_crossing
export * from './test_helpers';

View file

@ -8,6 +8,7 @@
"public/**/*",
"public/**/*.json",
"server/**/*",
"test_helpers/**/*",
"storybook/**/*",
"../../../typings/**/*"
],

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper, fontStyle } from '@kbn/presentation-util-plugin/common';
import { functionWrapper, fontStyle } from '@kbn/presentation-util-plugin/test_helpers';
import { testTable } from '../common/__fixtures__/test_tables';
import { markdown } from './markdown';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { all } from './all';
describe('all', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { getFunctionErrors } from '../../../i18n';
import { emptyTable, testTable } from './__fixtures__/test_tables';
import { alterColumn } from './alterColumn';

View file

@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { any } from './any';
describe('any', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { asFn } from './as';
describe('as', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { getFunctionErrors } from '../../../i18n';
import { testTable } from './__fixtures__/test_tables';
import { axisConfig } from './axisConfig';

View file

@ -7,7 +7,7 @@
import { of } from 'rxjs';
import { TestScheduler } from 'rxjs/testing';
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { caseFn } from './case';
describe('case', () => {

View file

@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { testTable } from './__fixtures__/test_tables';
import { clear } from './clear';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { emptyTable, testTable } from './__fixtures__/test_tables';
import { columns } from './columns';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { getFunctionErrors } from '../../../i18n';
import { compare } from './compare';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import { functionWrapper, getElasticLogo } from '@kbn/presentation-util-plugin/common';
import { getElasticLogo } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { getFunctionErrors } from '../../../i18n';
import { containerStyle } from './containerStyle';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { testTable, emptyTable } from './__fixtures__/test_tables';
import { context } from './context';

View file

@ -6,7 +6,7 @@
*/
import { SerializableRecord } from '@kbn/utility-types';
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { getFunctionErrors } from '../../../i18n';
import { csv } from './csv';
import { Datatable, ExecutionContext } from '@kbn/expressions-plugin/common';

View file

@ -6,7 +6,7 @@
*/
import sinon from 'sinon';
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { getFunctionErrors } from '../../../i18n';
import { date } from './date';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { doFn } from './do';
describe('do', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { testTable, relationalTable } from './__fixtures__/test_tables';
import { dropdownControl } from './dropdownControl';
import { ExecutionContext } from '@kbn/expressions-plugin/common';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { eq } from './eq';
describe('eq', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { emptyFilter } from './__fixtures__/test_filters';
import { exactly } from './exactly';

View file

@ -7,7 +7,7 @@
import { of } from 'rxjs';
import { TestScheduler } from 'rxjs/testing';
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { testTable } from './__fixtures__/test_tables';
import { filterrows } from './filterrows';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { formatdate } from './formatdate';
describe('formatdate', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { formatnumber } from './formatnumber';
describe('formatnumber', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { getFunctionErrors } from '../../../i18n';
import { emptyTable, testTable } from './__fixtures__/test_tables';
import { getCell } from './getCell';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { gt } from './gt';
describe('gt', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { gte } from './gte';
describe('gte', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { emptyTable, testTable } from './__fixtures__/test_tables';
import { head } from './head';

View file

@ -7,7 +7,7 @@
import { of } from 'rxjs';
import { TestScheduler } from 'rxjs/testing';
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { ifFn } from './if';
describe('if', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { getFunctionErrors } from '../../../i18n';
import { testTable } from './__fixtures__/test_tables';
import { joinRows } from './join_rows';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { lt } from './lt';
describe('lt', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { lte } from './lte';
describe('lte', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { neq } from './neq';
describe('neq', () => {

View file

@ -7,7 +7,7 @@
import { of } from 'rxjs';
import { TestScheduler } from 'rxjs/testing';
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { getFunctionErrors } from '../../../i18n';
import { testTable } from './__fixtures__/test_tables';
import { ply } from './ply';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { DEFAULT_ELEMENT_CSS } from '../../../common/lib/constants';
import { testTable } from './__fixtures__/test_tables';
import { fontStyle, getContainerStyle } from './__fixtures__/test_styles';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { replace } from './replace';
describe('replace', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { rounddate } from './rounddate';
describe('rounddate', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { emptyTable, testTable } from './__fixtures__/test_tables';
import { rowCount } from './rowCount';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { seriesStyle } from './seriesStyle';
describe('seriesStyle', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { testTable } from './__fixtures__/test_tables';
import { sort } from './sort';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { testTable, emptyTable } from './__fixtures__/test_tables';
import { staticColumn } from './staticColumn';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { string } from './string';
describe('string', () => {

View file

@ -7,7 +7,7 @@
import { of } from 'rxjs';
import { TestScheduler } from 'rxjs/testing';
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { switchFn } from './switch';
describe('switch', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper, fontStyle } from '@kbn/presentation-util-plugin/common';
import { functionWrapper, fontStyle } from '@kbn/presentation-util-plugin/test_helpers';
import { testTable } from './__fixtures__/test_tables';
import { table } from './table';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { emptyTable, testTable } from './__fixtures__/test_tables';
import { tail } from './tail';

View file

@ -6,7 +6,7 @@
*/
import sinon from 'sinon';
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { getFunctionErrors } from '../../../i18n';
import { emptyFilter } from './__fixtures__/test_filters';
import { timefilter } from './timefilter';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { functionWrapper } from '@kbn/presentation-util-plugin/common';
import { functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { timefilterControl } from './timefilterControl';
describe('timefilterControl', () => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { fontStyle, functionWrapper } from '@kbn/presentation-util-plugin/common';
import { fontStyle, functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { testPie } from '../../canvas_plugin_src/functions/common/__fixtures__/test_pointseries';
import {
grayscalePalette,

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { fontStyle, functionWrapper } from '@kbn/presentation-util-plugin/common';
import { fontStyle, functionWrapper } from '@kbn/presentation-util-plugin/test_helpers';
import { testPlot } from '../../canvas_plugin_src/functions/common/__fixtures__/test_pointseries';
import {
grayscalePalette,

View file

@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { fontStyle } from '@kbn/presentation-util-plugin/common';
import { fontStyle } from '@kbn/presentation-util-plugin/test_helpers';
import { defaultSpec, getFontSpec } from './get_font_spec';
describe('getFontSpec', () => {

View file

@ -19,8 +19,8 @@ import { createPackagePolicyMock, deletePackagePolicyMock } from '@kbn/fleet-plu
import { dataPluginMock } from '@kbn/data-plugin/server/mocks';
import { CspPlugin } from './plugin';
import { CspServerPluginStartDeps } from './types';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common/mocks';
import {
createFleetAuthzMock,
Installation,
ListResult,
PackagePolicy,

View file

@ -71,8 +71,6 @@ export {
} from './services';
export type { FleetAuthz } from './authz';
// eslint-disable-next-line @kbn/imports/no_boundary_crossing
export { createFleetAuthzMock } from './mocks';
export type {
// Request/Response
GetOneAgentResponse,

View file

@ -24,7 +24,7 @@ import type { FleetAppContext } from '../plugin';
import { createMockTelemetryEventsSender } from '../telemetry/__mocks__';
import type { FleetConfigType } from '../../common/types';
import type { ExperimentalFeatures } from '../../common/experimental_features';
import { createFleetAuthzMock } from '../../common';
import { createFleetAuthzMock } from '../../common/mocks';
import { agentServiceMock } from '../services/agents/agent_service.mock';
import type { FleetRequestHandlerContext } from '../types';
import { packageServiceMock } from '../services/epm/package_service.mock';

View file

@ -20,7 +20,7 @@ import { appContextService } from '../../services/app_context';
import { setupFleet } from '../../services/setup';
import type { FleetRequestHandlerContext } from '../../types';
import { createFleetAuthzMock } from '../../../common';
import { createFleetAuthzMock } from '../../../common/mocks';
import { fleetSetupHandler } from './handlers';

View file

@ -7,7 +7,7 @@
import { calculateEndpointAuthz, getEndpointAuthzInitialState } from './authz';
import type { FleetAuthz } from '@kbn/fleet-plugin/common';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common/mocks';
import { createLicenseServiceMock } from '../../../license/mocks';
import type { EndpointAuthzKeyList } from '../../types/authz';

View file

@ -10,7 +10,7 @@ import { act, renderHook } from '@testing-library/react-hooks';
import { securityMock } from '@kbn/security-plugin/public/mocks';
import type { AuthenticatedUser } from '@kbn/security-plugin/common';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common/mocks';
import type { EndpointPrivileges } from '../../../../../common/endpoint/types';
import { useCurrentUser, useKibana, useHttp as _useHttp } from '../../../lib/kibana';

View file

@ -20,7 +20,7 @@ import { licenseService as _licenseService } from '../common/hooks/use_license';
import type { LicenseService } from '../../common/license';
import { createLicenseServiceMock } from '../../common/license/mocks';
import type { FleetAuthz } from '@kbn/fleet-plugin/common';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common/mocks';
import type { DeepPartial } from '@kbn/utility-types';
import { merge } from 'lodash';
import { ENDPOINT_ARTIFACT_LISTS } from '@kbn/securitysolution-list-constants';

View file

@ -39,7 +39,7 @@ import {
// file and not bundled with the application, adding a eslint disable below and using import from
// a restricted path.
import { createCasesClientMock } from '@kbn/cases-plugin/server/client/mocks';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common/mocks';
import type { RequestFixtureOptions } from '@kbn/core-http-router-server-mocks';
import type { ElasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks';
import { getEndpointAuthzInitialStateMock } from '../../common/endpoint/service/authz/mocks';

View file

@ -14,7 +14,7 @@ import { BaseValidatorMock, createExceptionItemLikeOptionsMock } from './mocks';
import { EndpointArtifactExceptionValidationError } from './errors';
import { httpServerMock } from '@kbn/core/server/mocks';
import type { PackagePolicy } from '@kbn/fleet-plugin/common';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common';
import { createFleetAuthzMock } from '@kbn/fleet-plugin/common/mocks';
import type { PackagePolicyClient } from '@kbn/fleet-plugin/server';
import type { ExceptionItemLikeOptions } from '../types';
import {