Skip to content

Commit

Permalink
remove failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiota committed Dec 3, 2021
1 parent 84a6eac commit 9b136d0
Showing 1 changed file with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@ import { elasticsearchServiceMock } from 'src/core/server/mocks';
import { AlertConsumers } from '@kbn/rule-data-utils/alerts_as_data_rbac';
import { Dataset } from './index_options';
import { RuleDataClient } from '../rule_data_client/rule_data_client';
import { ResourceInstaller } from './resource_installer';
import { resourceInstallerMock as mockResourceInstaller } from './resource_installer.mock';
import { createRuleDataClientMock as mockCreateRuleDataClient } from '../rule_data_client/rule_data_client.mock';

jest.mock('../rule_data_client/rule_data_client', () => ({
RuleDataClient: jest.fn().mockImplementation(() => mockCreateRuleDataClient()),
}));
jest.mock('./resource_installer', () => ({
ResourceInstaller: jest.fn().mockImplementation(() => mockResourceInstaller.create()),
}));

describe('ruleDataPluginService', () => {
beforeEach(() => {
Expand Down Expand Up @@ -76,24 +72,6 @@ describe('ruleDataPluginService', () => {
});
});

describe('initializeService', () => {
it('calls ResourceInstaller', async () => {
const mockClusterClient = elasticsearchServiceMock.createElasticsearchClient();
const getClusterClient = jest.fn(() => Promise.resolve(mockClusterClient));

new RuleDataService({
logger: loggerMock.create(),
getClusterClient,
kibanaVersion: '8.1.0',
isWriteEnabled: true,
disabledRegistrationContexts: ['observability.logs'],
isWriterCacheEnabled: true,
});

expect(ResourceInstaller).toHaveBeenCalled();
});
});

describe('initializeIndex', () => {
it('calls RuleDataClient', async () => {
const mockClusterClient = elasticsearchServiceMock.createElasticsearchClient();
Expand Down

0 comments on commit 9b136d0

Please sign in to comment.