react-conventions
Version:
An open source set of React components that implement Ambassador's Design and UX patterns.
16 lines (14 loc) • 643 B
JavaScript
import React from 'react';
import { shallow } from 'enzyme';
import Icon from '../src/components/Icon/Icon';
describe('Icon', () => {
it('should render an svg with attribute values', () => {
const wrapper = shallow(<Icon name='icon-check-1-1' width='12' height='24' fill='green' className='custom' />);
expect(wrapper.find('svg')).to.have.length(1);
expect(wrapper.props().name).to.equal('icon-check-1-1');
expect(wrapper.props().width).to.equal('12');
expect(wrapper.props().height).to.equal('24');
expect(wrapper.props().fill).to.equal('green');
expect(wrapper.props().className).to.equal('custom');
});
});