Skip to content

Commit

Permalink
Fix typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Apr 12, 2021
1 parent bf2dfda commit f1dbd66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
20 changes: 4 additions & 16 deletions x-pack/plugins/fleet/server/services/preconfiguration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,8 @@ describe('policy preconfiguration', () => {

it('should install packages and configure agent policies successfully', async () => {
const soClient = getPutPreconfiguredPackagesMock();
const esClient = elasticsearchServiceMock.createInternalClient();
esClient.search.mockResolvedValue({
body: {
hits: {
total: 0,
},
},
});
const esClient = createMockESClient();

const { policies, packages } = await ensurePreconfiguredPackagesAndPolicies(
soClient,
esClient,
Expand Down Expand Up @@ -226,14 +220,8 @@ describe('policy preconfiguration', () => {

it('should not attempt to recreate or modify an agent policy if its ID is unchanged', async () => {
const soClient = getPutPreconfiguredPackagesMock();
const esClient = elasticsearchServiceMock.createInternalClient();
esClient.search.mockResolvedValue({
body: {
hits: {
total: 0,
},
},
});
const esClient = createMockESClient();

const { policies: policiesA } = await ensurePreconfiguredPackagesAndPolicies(
soClient,
esClient,
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/fleet/server/services/preconfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ import type {
PreconfiguredAgentPolicy,
PreconfiguredPackage,
} from '../../common';
import { PRECONFIGURATION_METADATA_INDEX } from '../constants';

import { pkgToPkgKey } from './epm/registry';
import { getInstallation } from './epm/packages';
import { ensureInstalledPackage } from './epm/packages/install';
import { agentPolicyService, addPackageToAgentPolicy } from './agent_policy';
import { packagePolicyService } from './package_policy';

export type InputsOverride = Partial<NewPackagePolicyInput> & {
vars?: Array<NewPackagePolicyInput['vars'] & { name: string }>;
Expand Down

0 comments on commit f1dbd66

Please sign in to comment.