Updating Pin rendering to use react-testing-library
This commit is contained in:
		
							parent
							
								
									f63e9b2a47
								
							
						
					
					
						commit
						c8068762b5
					
				| @ -11,15 +11,13 @@ Object { | |||||||
| `; | `; | ||||||
| 
 | 
 | ||||||
| exports[`Pin rendering 1`] = ` | exports[`Pin rendering 1`] = ` | ||||||
| <circle | <DocumentFragment> | ||||||
|   r={5} |   <svg> | ||||||
|   style={ |     <circle | ||||||
|     Object { |       r="5" | ||||||
|       "fill": "#6b6659", |       style="fill: #6b6659; stroke-width: 2px; stroke: #000;" | ||||||
|       "stroke": "#000", |  | ||||||
|       "strokeWidth": "2px", |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|       transform="translate(5 5)" |       transform="translate(5 5)" | ||||||
| /> |     /> | ||||||
|  |   </svg> | ||||||
|  | </DocumentFragment> | ||||||
| `; | `; | ||||||
|  | |||||||
| @ -1,14 +1,16 @@ | |||||||
| import React from 'react'; | import React from 'react'; | ||||||
| import { shallow } from 'enzyme'; | import { render } from 'react-testing-library'; | ||||||
| 
 | 
 | ||||||
| import Pin, { layout } from 'rendering/Pin'; | import Pin, { layout } from 'rendering/Pin'; | ||||||
| 
 | 
 | ||||||
| describe('Pin', () => { | describe('Pin', () => { | ||||||
|   test('rendering', () => { |   test('rendering', () => { | ||||||
|     const component = shallow( |     const { asFragment } = render( | ||||||
|  |       <svg> | ||||||
|         <Pin/> |         <Pin/> | ||||||
|  |       </svg> | ||||||
|     ); |     ); | ||||||
|     expect(component).toMatchSnapshot(); |     expect(asFragment()).toMatchSnapshot(); | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|   test('layout', () => { |   test('layout', () => { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user