update mock and types (#95771)

This commit is contained in:
Shahzad 2021-03-30 17:51:52 +02:00 committed by GitHub
parent c8bc57257b
commit a154d92d6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -19,7 +19,9 @@ export type {
SeriesType,
ValueLabelConfig,
YAxisMode,
XYCurveType,
} from './xy_visualization/types';
export type { DataType } from './types';
export type {
PieVisualizationState,
PieLayerState,

View file

@ -5,16 +5,20 @@
* 2.0.
*/
import React from 'react';
import { LensPublicStart } from '.';
import { visualizationTypes } from './xy_visualization/types';
export type Start = jest.Mocked<LensPublicStart>;
const createStartContract = (): Start => {
const startContract: Start = {
EmbeddableComponent: jest.fn(() => null),
EmbeddableComponent: jest.fn(() => {
return <span>Lens Embeddable Component</span>;
}),
canUseEditor: jest.fn(() => true),
navigateToPrefilledEditor: jest.fn(),
getXyVisTypes: jest.fn(),
getXyVisTypes: jest.fn().mockReturnValue(new Promise(() => visualizationTypes)),
};
return startContract;
};