UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

43 lines 1.44 kB
import React from 'react'; import assert from 'assert'; import { common } from '../../util/generic-tests'; import { shallow } from 'enzyme'; import Line from './Line'; describe('Line', function () { common(Line); describe('props', function () { describe('d', function () { it('should pass through', function () { var wrapper = shallow( /*#__PURE__*/React.createElement(Line, { d: "foo" })); assert.equal(wrapper.find('path').prop('d'), 'foo'); }); }); describe('color', function () { it('should apply color strings as a class', function () { var wrapper = shallow( /*#__PURE__*/React.createElement(Line, { color: "wat" })); assert(wrapper.find('path').hasClass('lucid-Line-wat'), 'missing color class'); }); it('should apply custom colors to `style`', function () { var wrapper = shallow( /*#__PURE__*/React.createElement(Line, { color: "#A00B00" })); assert.deepEqual(wrapper.find('path').prop('style'), { fill: '#A00B00', stroke: '#A00B00' }); }); }); describe('isDotted', function () { it('should apply the correct class', function () { var wrapper = shallow( /*#__PURE__*/React.createElement(Line, { isDotted: true })); assert(wrapper.find('path').hasClass('lucid-Line-is-dotted')); }); }); }); });