Skip to content

Commit

Permalink
add unit test for hosts (#76927)
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed Sep 8, 2020
1 parent f351400 commit a06ade9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 113 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { hostsFactory } from '.';
import { HostsQueries } from '../../../../../common/search_strategy';
import { allHosts } from './all';
import { hostDetails } from './details';
import { hostOverview } from './overview';
import { firstLastSeenHost } from './last_first_seen';
import { uncommonProcesses } from './uncommon_processes';
import { authentications } from './authentications';

jest.mock('./all');
jest.mock('./details');
jest.mock('./overview');
jest.mock('./last_first_seen');
jest.mock('./uncommon_processes');
jest.mock('./authentications');

describe('hostsFactory', () => {
test('should include correct apis', () => {
const expectedHostsFactory = {
[HostsQueries.details]: hostDetails,
[HostsQueries.hosts]: allHosts,
[HostsQueries.overview]: hostOverview,
[HostsQueries.firstLastSeen]: firstLastSeenHost,
[HostsQueries.uncommonProcesses]: uncommonProcesses,
[HostsQueries.authentications]: authentications,
};
expect(hostsFactory).toEqual(expectedHostsFactory);
});
});

0 comments on commit a06ade9

Please sign in to comment.