Skip to content

Commit

Permalink
Fix filter_ratio and histogram_support tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DianaDerevyankina committed Aug 27, 2020
1 parent 22a0071 commit 84fe114
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ import { mountWithIntl } from 'test_utils/enzyme_helpers';
import { FilterRatioAgg } from './filter_ratio';
import { FIELDS, METRIC, SERIES, PANEL } from '../../../test_utils';
import { EuiComboBox } from '@elastic/eui';
import { dataPluginMock } from '../../../../../data/public/mocks';
import { setDataStart } from '../../../services';

jest.mock('../query_bar_wrapper', () => ({
QueryBarWrapper: jest.fn(() => null),
}));

jest.mock('../lib/get_default_query_language', () => ({
getDefaultQueryLanguage: jest.fn(() => 'lucene'),
}));

describe('TSVB Filter Ratio', () => {
beforeAll(() => setDataStart(dataPluginMock.createStartContract()));

const setup = (metric) => {
const series = { ...SERIES, metrics: [metric] };
const panel = { ...PANEL, series };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ import { mountWithIntl } from 'test_utils/enzyme_helpers';
import { Agg } from './agg';
import { FieldSelect } from './field_select';
import { FIELDS, METRIC, SERIES, PANEL } from '../../../test_utils';
import { setDataStart } from '../../../services';
import { dataPluginMock } from '../../../../../data/public/mocks';

jest.mock('../query_bar_wrapper', () => ({
QueryBarWrapper: jest.fn(() => null),
}));

jest.mock('../lib/get_default_query_language', () => ({
getDefaultQueryLanguage: jest.fn(() => 'lucene'),
}));

const runTest = (aggType, name, test, additionalProps = {}) => {
describe(aggType, () => {
const metric = {
Expand Down Expand Up @@ -64,6 +62,8 @@ const runTest = (aggType, name, test, additionalProps = {}) => {
};

describe('Histogram Types', () => {
beforeAll(() => setDataStart(dataPluginMock.createStartContract()));

describe('supported', () => {
const shouldHaveHistogramSupport = (aggType, additionalProps = {}) => {
runTest(
Expand Down

0 comments on commit 84fe114

Please sign in to comment.