Skip to content

Commit

Permalink
🐛 Fix tests affected by signature change
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Jan 29, 2021
1 parent b2f9fe0 commit daf688d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ const indexPattern2: IndexPattern = {
]),
};

const uiSettingsMock = {} as IUiSettingsClient;

const defaultOptions = {
storage: {} as IStorageWrapper,
uiSettings: {} as IUiSettingsClient,
uiSettings: uiSettingsMock,
savedObjectsClient: {} as SavedObjectsClientContract,
dateRange: {
fromDate: 'now-1y',
Expand Down Expand Up @@ -200,7 +202,8 @@ describe('date_histogram', () => {
layer.columns.col1 as DateHistogramIndexPatternColumn,
'col1',
indexPattern1,
layer
layer,
uiSettingsMock
);
expect(esAggsFn).toEqual(
expect.objectContaining({
Expand Down Expand Up @@ -252,7 +255,8 @@ describe('date_histogram', () => {
},
]),
},
layer
layer,
uiSettingsMock
);
expect(esAggsFn).toEqual(
expect.objectContaining({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import type { IndexPatternLayer } from '../../../types';
import { createMockedIndexPattern } from '../../../mocks';
import { FilterPopover } from './filter_popover';

const uiSettingsMock = {} as IUiSettingsClient;

const defaultProps = {
storage: {} as IStorageWrapper,
uiSettings: {} as IUiSettingsClient,
uiSettings: uiSettingsMock,
savedObjectsClient: {} as SavedObjectsClientContract,
dateRange: { fromDate: 'now-1d', toDate: 'now' },
data: dataPluginMock.createStartContract(),
Expand Down Expand Up @@ -84,7 +86,8 @@ describe('filters', () => {
layer.columns.col1 as FiltersIndexPatternColumn,
'col1',
createMockedIndexPattern(),
layer
layer,
uiSettingsMock
);
expect(esAggsFn).toEqual(
expect.objectContaining({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import { LastValueIndexPatternColumn } from './last_value';
import { lastValueOperation } from './index';
import type { IndexPattern, IndexPatternLayer } from '../../types';

const uiSettingsMock = {} as IUiSettingsClient;

const defaultProps = {
storage: {} as IStorageWrapper,
uiSettings: {} as IUiSettingsClient,
uiSettings: uiSettingsMock,
savedObjectsClient: {} as SavedObjectsClientContract,
dateRange: { fromDate: 'now-1d', toDate: 'now' },
data: dataPluginMock.createStartContract(),
Expand Down Expand Up @@ -70,7 +72,8 @@ describe('last_value', () => {
{ ...lastValueColumn, params: { ...lastValueColumn.params } },
'col1',
{} as IndexPattern,
layer
layer,
uiSettingsMock
);
expect(esAggsFn).toEqual(
expect.objectContaining({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ import { EuiFieldNumber } from '@elastic/eui';
import { act } from 'react-dom/test-utils';
import { EuiFormRow } from '@elastic/eui';

const uiSettingsMock = {} as IUiSettingsClient;

const defaultProps = {
storage: {} as IStorageWrapper,
uiSettings: {} as IUiSettingsClient,
uiSettings: uiSettingsMock,
savedObjectsClient: {} as SavedObjectsClientContract,
dateRange: { fromDate: 'now-1d', toDate: 'now' },
data: dataPluginMock.createStartContract(),
Expand Down Expand Up @@ -72,7 +74,8 @@ describe('percentile', () => {
percentileColumn,
'col1',
{} as IndexPattern,
layer
layer,
uiSettingsMock
);
expect(esAggsFn).toEqual(
expect.objectContaining({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ import type { TermsIndexPatternColumn } from '.';
import { termsOperation } from '../index';
import { IndexPattern, IndexPatternLayer } from '../../../types';

const uiSettingsMock = {} as IUiSettingsClient;

const defaultProps = {
storage: {} as IStorageWrapper,
uiSettings: {} as IUiSettingsClient,
uiSettings: uiSettingsMock,
savedObjectsClient: {} as SavedObjectsClientContract,
dateRange: { fromDate: 'now-1d', toDate: 'now' },
data: dataPluginMock.createStartContract(),
Expand Down Expand Up @@ -66,7 +68,8 @@ describe('terms', () => {
{ ...termsColumn, params: { ...termsColumn.params, otherBucket: true } },
'col1',
{} as IndexPattern,
layer
layer,
uiSettingsMock
);
expect(esAggsFn).toEqual(
expect.objectContaining({
Expand All @@ -89,7 +92,8 @@ describe('terms', () => {
},
'col1',
{} as IndexPattern,
layer
layer,
uiSettingsMock
);
expect(esAggsFn).toEqual(
expect.objectContaining({
Expand Down Expand Up @@ -129,7 +133,8 @@ describe('terms', () => {
},
},
},
}
},
uiSettingsMock
);
expect(esAggsFn).toEqual(
expect.objectContaining({
Expand Down

0 comments on commit daf688d

Please sign in to comment.