File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
x-pack/plugins/lens/public/indexpattern_datasource Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { DataPublicPluginStart } from '../../../../../src/plugins/data/public';
1616import { dataPluginMock } from '../../../../../src/plugins/data/public/mocks' ;
1717import { IndexPattern } from './types' ;
1818import { chartPluginMock } from '../../../../../src/plugins/charts/public/mocks' ;
19+ import { documentField } from './document_field' ;
1920
2021const chartsThemeService = chartPluginMock . createSetupContract ( ) . theme ;
2122
@@ -70,6 +71,7 @@ describe('IndexPattern Field Item', () => {
7071 aggregatable : true ,
7172 searchable : true ,
7273 } ,
74+ documentField ,
7375 ] ,
7476 } as IndexPattern ;
7577
@@ -263,4 +265,14 @@ describe('IndexPattern Field Item', () => {
263265 }
264266 ) ;
265267 } ) ;
268+
269+ it ( 'should not request field stats for document field' , async ( ) => {
270+ const wrapper = mountWithIntl ( < InnerFieldItem { ...defaultProps } field = { documentField } /> ) ;
271+
272+ clickField ( wrapper , 'Records' ) ;
273+
274+ expect ( core . http . post ) . not . toHaveBeenCalled ( ) ;
275+ expect ( wrapper . find ( EuiPopover ) . prop ( 'isOpen' ) ) . toEqual ( true ) ;
276+ expect ( wrapper . find ( EuiLoadingSpinner ) ) . toHaveLength ( 0 ) ;
277+ } ) ;
266278} ) ;
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export const InnerFieldItem = function InnerFieldItem(props: FieldItemProps) {
122122 } ) ;
123123
124124 function fetchData ( ) {
125- if ( state . isLoading ) {
125+ if ( state . isLoading || field . type === 'document' ) {
126126 return ;
127127 }
128128
You can’t perform that action at this time.
0 commit comments