Skip to content

Commit

Permalink
Fix tests after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Feb 5, 2021
1 parent 8dd23bf commit 288c861
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x-pack/plugins/fleet/server/services/agents/reassign.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ function createClientMock() {
saved_objects: [await soClientMock.create(type, attributes)],
};
});
soClientMock.bulkUpdate.mockResolvedValue({
saved_objects: [],
});

soClientMock.get.mockImplementation(async (_, id) => {
switch (id) {
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/fleet/server/services/agents/unenroll.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ describe('unenrollAgents (plural)', () => {
});
it('cannot unenroll from a managed policy', async () => {
const soClient = createClientMock();

const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser;
const idsToUnenroll = [agentInUnmanagedSO.id, agentInManagedSO.id, agentInUnmanagedSO2.id];
await unenrollAgents(soClient, esClient, { agentIds: idsToUnenroll });
Expand All @@ -98,6 +99,9 @@ function createClientMock() {
saved_objects: [await soClientMock.create(type, attributes)],
};
});
soClientMock.bulkUpdate.mockResolvedValue({
saved_objects: [],
});

soClientMock.get.mockImplementation(async (_, id) => {
switch (id) {
Expand Down

0 comments on commit 288c861

Please sign in to comment.