Skip to content

Commit

Permalink
Fix types in test
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-tavares committed Oct 28, 2024
1 parent 7f710ae commit 736103d
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ import { ensureIndicesExistsForPolicies } from './ensure_indices_exists_for_poli
import { createPolicyDataStreamsIfNeeded as _createPolicyDataStreamsIfNeeded } from '../../fleet_integration/handlers/create_policy_datastreams';

jest.mock('../../fleet_integration/handlers/create_policy_datastreams');
const createPolicyDataStreamsIfNeededMock = _createPolicyDataStreamsIfNeeded as jest.Mock;
const createPolicyDataStreamsIfNeededMock =
_createPolicyDataStreamsIfNeeded as unknown as jest.Mock;

describe('Ensure indices exists for policies migration', () => {
let endpointAppContextServicesMock: ReturnType<typeof createMockEndpointAppContextService>;

beforeEach(() => {
endpointAppContextServicesMock = createMockEndpointAppContextService();

endpointAppContextServicesMock
.getInternalFleetServices()
.packagePolicy.listIds.mockResolvedValue({
items: ['foo-1', 'foo-2', 'foo-3'],
});
(
endpointAppContextServicesMock.getInternalFleetServices().packagePolicy.listIds as jest.Mock
).mockResolvedValue({
items: ['foo-1', 'foo-2', 'foo-3'],
});
});

it('should query fleet looking for all endpoint integration policies', async () => {
Expand Down

0 comments on commit 736103d

Please sign in to comment.