import './class-name';
import { shallow, mount } from 'enzyme';
import { eachRenderMethod } from '../../test-setup/each-render-method';
import React from 'react';

const ClassNameFixture = () => (
  <div className="special burger">Content here</div>
);

describe('Should enzyme add check hasClass', () => {
  const shouldEnzyme = should;

  it('should have new method className', () => {
    shouldEnzyme.should.have.property('className');
  });

  eachRenderMethod((renderMethod, methodName) => {
    context(methodName, () => {
      let wrapper;

      before(() => {
        wrapper = renderMethod(<ClassNameFixture />);
      });

      it('should contain class name "special" in ClassNameFixture', () => {
        wrapper.should.have.className('special');
      });

      it('should NOT contain class name "pizza" in ClassNameFixture', () => {
        wrapper.should.not.have.className('pizza');
      });

      it('assert should fail to see useful error message', () => {
        (() => wrapper.should.have.className('pizza'))
        .should.throwError(/expected '(div|ClassNameFixture)' to have className 'pizza' but found 'special burger'/);
      });
    });
  });
});

import './class-name';
import { eachRenderMethod } from '../../test-setup/each-render-method';
import React from 'react';

const ClassNameFixture = () => (
  <div className="special burger">Content here</div>
);

describe('Should enzyme add check hasClass', () => {
  const shouldEnzyme = should;

  it('should have new method className', () => {
    shouldEnzyme.should.have.property('className');
  });

  eachRenderMethod((renderMethod, methodName) => {
    context(methodName, () => {
      let wrapper;

      before(() => {
        wrapper = renderMethod(<ClassNameFixture />);
      });

      it('should contain class name "special" in ClassNameFixture', () => {
        wrapper.should.have.className('special');
      });

      it('should NOT contain class name "pizza" in ClassNameFixture', () => {
        wrapper.should.not.have.className('pizza');
      });

      it('assert should fail to see useful error message', () => {
        (() => wrapper.should.have.className('pizza'))
        .should.throwError(/expected '(div|ClassNameFixture)' to have className 'pizza' but found 'special burger'/);
      });
    });
  });
});

fix linting issue in class-name spec.