File: __tests__/Rectangle.test.js

Recommend this page to a friend!
  Classes of Manolo Salsas   React JS SVG Library   __tests__/Rectangle.test.js   Download  
File: __tests__/Rectangle.test.js
Role: Example script
Content type: text/plain
Description: Example script
Class: React JS SVG Library
Generate animated graphics in SVG using React JS
Author: By
Last change: Add tests with Jest
Date: 2 years ago
Size: 650 bytes
 

Contents

Class file image Download
import React from 'react'; import Rectangle from '../src/Rectangle'; import { shallow, configure } from 'enzyme'; import Adapter from 'enzyme-adapter-react-16'; configure({adapter: new Adapter()}); describe('Test Rectangle component', () => { const props = { width : 100, height : 200, strokeWidth: 5, strokeColor: 'orange', fillColor : 'none' }; const rectangle = shallow((<Rectangle {...props}/>)); it('should be defined', () => { expect(rectangle).toBeDefined(); }); it('should render correctly', () => { expect(rectangle).toMatchSnapshot(); }); });