import { render } from 'enzyme' ; import React from 'react' ; import { EmbeddedMap } from './embedded_map' ; import { KibanaContextProvider } from '../../../../../../../../src/plugins/kibana_react/public' ; import { embeddablePluginMock } from '../../../../../../../../src/plugins/embeddable/public/mocks' ; describe ( 'Embedded Map' , ( ) => { test ( 'it renders' , ( ) => { const [ core ] = mockCore ( ) ; const wrapper = render ( < KibanaContextProvider services = { { ... core } } > < EmbeddedMap /> < /KibanaContextProvider>); expect ( wrapper ) . toMatchSnapshot ( ) ; } ) ; } ) ; const mockEmbeddable = embeddablePluginMock . createStartContract ( ) ; mockEmbeddable . getEmbeddableFactory = jest . fn ( ) . mockImplementation ( ( ) => ( { create : ( ) => ( { reload : jest . fn ( ) , setRenderTooltipContent : jest . fn ( ) , setLayerList : jest . fn ( ) , } ) , } ) ) ; const mockCore = ( ) => { const core = { embeddable : mockEmbeddable , } ; return [ core ] ; } ;