Icontem

File: __tests__/Line.test.js

Recommend this page to a friend!
  Classes of Manolo Salsas  >  React JS SVG Library  >  __tests__/Line.test.js  >  Download  
File: __tests__/Line.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:
Date: 9 months ago
Size: 626 bytes
 

Contents

Class file image Download
import React from 'react';
import Line from '../src/Line';
import { shallow, configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

configure({adapter: new Adapter()});

describe('Test Line component', () => {
    const props = {
        lineLength   : 50,
        degrees      : 120,
        strokeWidth  : 10,
        strokeColor  : 'yellow',
        strokeLinecap: 'round'
    };
    const line = shallow((<Line {...props}/>));

    it('should be defined', () => {
        expect(line).toBeDefined();
    });
    it('should render correctly', () => {
        expect(line).toMatchSnapshot();
    });
});