import React from 'react';
import { mount } from 'enzyme';
import StatefulRenderCounter from '../../src/RenderCounter/StatefulRenderCounter';
import StatelessRenderCounter from '../../src/RenderCounter/StatelessRenderCounter';

const testWrapper = (RenderCounter, name = 'RenderCounter') => describe(name, () => {
  it('should change the text after update', () => {
    // Render a checkbox with label in the document
    const wrapper = mount(<RenderCounter />);

    expect(wrapper.text()).toEqual('1');
    wrapper.update();
    expect(wrapper.text()).toEqual('2');
  });

  it('should not change the text after another RenderCounter\'s update', () => {
    // Render a checkbox with label in the document
    const wrapper1 = mount(<RenderCounter />);
    const wrapper2 = mount(<RenderCounter />);

    expect(wrapper2.text()).toEqual('1');
    wrapper1.update();
    expect(wrapper2.text()).toEqual('1');
  });
});

testWrapper(StatefulRenderCounter, 'StatefulRenderCounter');
testWrapper(StatelessRenderCounter, 'ComposedRenderCounter');

@@ -363,60 +363,8 @@
 %3E %7B%0A
-    // Render a checkbox with label in the document%0A
     
@@ -397,32 +397,32 @@
 derCounter /%3E);%0A
+
 %0A    expect(wrap
@@ -517,16 +517,271 @@
 %0A  %7D);%0A%0A
+  it('should accept a prop initialCount as the initial value of count', () =%3E %7B%0A    const wrapper = mount(%3CRenderCounter initialCount=%7B2%7D /%3E);%0A%0A    expect(wrapper.text()).toEqual('2');%0A    wrapper.update();%0A    expect(wrapper.text()).toEqual('3');%0A  %7D);%0A%0A
   it('sh
@@ -857,60 +857,8 @@
 %3E %7B%0A
-    // Render a checkbox with label in the document%0A
     

test initialCount