Skip to content

Commit

Permalink
remove iindexpattern usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Jan 30, 2022
1 parent 6fd7079 commit 15b6c5e
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';

import { ScriptedFieldsTable } from '../scripted_fields_table';
import { IIndexPattern, IndexPattern } from '../../../../../../plugins/data/common';
import { DataView } from '../../../../../../plugins/data_views/public';

jest.mock('@elastic/eui', () => ({
EuiTitle: 'eui-title',
Expand Down Expand Up @@ -40,10 +40,10 @@ const helpers = {
getRouteHref: () => '#',
};

const getIndexPatternMock = (mockedFields: any = {}) => ({ ...mockedFields } as IIndexPattern);
const getIndexPatternMock = (mockedFields: any = {}) => ({ ...mockedFields } as DataView);

describe('ScriptedFieldsTable', () => {
let indexPattern: IndexPattern;
let indexPattern: DataView;

beforeEach(() => {
indexPattern = getIndexPatternMock({
Expand All @@ -56,7 +56,7 @@ describe('ScriptedFieldsTable', () => {
script: 'z++',
},
],
}) as IndexPattern;
}) as DataView;
});

test('should render normally', async () => {
Expand Down Expand Up @@ -112,7 +112,7 @@ describe('ScriptedFieldsTable', () => {
{ isUserEditable: true, name: 'JustATest', lang: 'painless', script: 'z++' },
{ isUserEditable: true, name: 'Bad', lang: 'somethingElse', script: 'z++' },
],
}) as IndexPattern
}) as DataView
}
painlessDocLink={'painlessDoc'}
helpers={helpers}
Expand All @@ -137,7 +137,7 @@ describe('ScriptedFieldsTable', () => {
indexPattern={
getIndexPatternMock({
getScriptedFields: () => [],
}) as IndexPattern
}) as DataView
}
painlessDocLink={'painlessDoc'}
helpers={helpers}
Expand Down Expand Up @@ -184,7 +184,7 @@ describe('ScriptedFieldsTable', () => {
{
...indexPattern,
removeScriptedField,
} as unknown as IndexPattern
} as unknown as DataView
}
helpers={helpers}
painlessDocLink={'painlessDoc'}
Expand Down

0 comments on commit 15b6c5e

Please sign in to comment.