Icon.test.js 621 B

123456789101112131415161718192021
  1. import React from 'react';
  2. import { expect } from 'chai';
  3. import { shallow } from 'enzyme';
  4. import '../stubs';
  5. import Icon from '../../src/components/icon/Icon';
  6. describe('Icon', () => {
  7. it('exists', () => {
  8. // eslint-disable-next-line no-unused-expressions
  9. expect(Icon).to.exist;
  10. });
  11. it('has just icon classes by default', () => {
  12. expect(shallow(<Icon name="test" />).is('.icon.icon-test')).to.equal(true);
  13. });
  14. it('has additional classes if specified', () => {
  15. expect(shallow(<Icon name="test" className="icon-red icon-big" />).prop('className')).to.contain('icon-red icon-big');
  16. });
  17. });