| 
									
										
										
										
											2019-02-05 19:47:42 +08:00
										 |  |  | import React from 'react'; | 
					
						
							|  |  |  | import { shallow } from 'enzyme'; | 
					
						
							| 
									
										
										
										
											2020-02-10 21:23:54 +08:00
										 |  |  | import { AddPanelWidgetUnconnected as AddPanelWidget, Props } from './AddPanelWidget'; | 
					
						
							| 
									
										
										
										
											2019-02-05 19:47:42 +08:00
										 |  |  | import { DashboardModel, PanelModel } from '../../state'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const setup = (propOverrides?: object) => { | 
					
						
							|  |  |  |   const props: Props = { | 
					
						
							|  |  |  |     dashboard: {} as DashboardModel, | 
					
						
							|  |  |  |     panel: {} as PanelModel, | 
					
						
							| 
									
										
										
										
											2020-02-23 04:08:42 +08:00
										 |  |  |     addPanel: jest.fn() as any, | 
					
						
							| 
									
										
										
										
											2019-02-05 19:47:42 +08:00
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Object.assign(props, propOverrides); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return shallow(<AddPanelWidget {...props} />); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | describe('Render', () => { | 
					
						
							|  |  |  |   it('should render component', () => { | 
					
						
							|  |  |  |     const wrapper = setup(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     expect(wrapper).toMatchSnapshot(); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); |