import './class-name';
import { shallow, mount } from 'enzyme';
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');
  });

  context('using ShallowWrapper', () => {
    let wrapper;

    before(() => {
      wrapper = shallow(<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' to have className 'pizza' but found 'special burger'/);
    });
  });

  context('using ReactWrapper', () => {
    let wrapper;

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

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

});

@@ -53,24 +53,96 @@
 m 'enzyme';%0A
+import %7B eachRenderMethod %7D from '../../test-setup/each-render-method';%0A
 import React
@@ -446,38 +446,79 @@
 %0A%0A  
-context('using ShallowWrapper'
+eachRenderMethod((renderMethod, methodName) =%3E %7B%0A    context(methodName
 , ()
@@ -519,32 +519,34 @@
 me, () =%3E %7B%0A    
+ 
+ 
 let wrapper;%0A%0A  
@@ -535,32 +535,34 @@
   let wrapper;%0A%0A
+  
     before(() =%3E
@@ -562,32 +562,34 @@
 e(() =%3E %7B%0A      
+ 
+ 
 wrapper = shallo
@@ -582,23 +582,28 @@
 apper = 
-shallow
+renderMethod
 (%3CClassN
@@ -614,37 +614,41 @@
 ixture /%3E);%0A    
+  
 %7D);%0A%0A
+  
     it('should c
@@ -703,32 +703,34 @@
 , () =%3E %7B%0A      
+ 
+ 
 wrapper.should.h
@@ -751,37 +751,41 @@
 'special');%0A    
+  
 %7D);%0A%0A
+  
     it('should N
@@ -836,32 +836,34 @@
 xture', () =%3E %7B%0A
+  
       wrapper.sh
@@ -896,29 +896,33 @@
 izza');%0A    
+  
 %7D);%0A%0A
+  
     it('asse
@@ -970,24 +970,26 @@
 e', () =%3E %7B%0A
+  
       (() =%3E
@@ -1035,16 +1035,18 @@
 )%0A      
+  
 .should.
@@ -1067,19 +1067,38 @@
 pected '
+(
 div
+%7CClassNameFixture)
 ' to hav
@@ -1155,284 +1155,13 @@
     
-%7D);%0A
   %7D);
-%0A%0A  context('using ReactWrapper', () =%3E %7B%0A    let wrapper;%0A%0A    before(() =%3E %7B%0A      wrapper = mount(%3CClassNameFixture /%3E);%0A    %7D);%0A%0A    it('should contain class name %22special%22 in ClassNameFixture wrapping div', () =%3E %7B%0A      wrapper.should.have.className('special');
 %0A   
@@ -1171,13 +1171,12 @@
 ;%0A  %7D);%0A
-%0A
 %7D);%0A

clean up classname assertion tests.