import React from 'react';
import { expect } from 'chai';
import { mount } from 'enzyme';
import Incident from '../js/components/Incident';
import styles from '../js/components/Incident.css';
const moment = require('moment');

describe('<Incident />', function () {
  const incident = {
    id: '23103810',
    date: moment('2016-02-03'),
    address: '530 S. State',
    description: 'Hello world!'
  };

  it('should initially not be showing text', function () {
    const wrapper = mount(<Incident incident={incident} />);
    expect(wrapper.state().showText).to.eql(false);
  });

  it('should have a div with incident class', function () {
    const wrapper = mount(<Incident incident={incident} />);
    expect(styles.incident).to.not.be.empty;
    expect(wrapper.closest(`div.${styles.incident}`)).to.have.length(1);
  });
});

@@ -822,13 +822,587 @@
 );%0A  %7D);
+%0A%0A  it('should change the text state on clicking the GridTile', function () %7B%0A    const wrapper = mount(%3CIncident incident=%7Bincident%7D /%3E);%0A    wrapper.find('GridTile').simulate('click');%0A    expect(wrapper.state().showText).to.eql(true);%0A  %7D);%0A%0A  it('should change the text state back to default on clicking the textual incident', function () %7B%0A    const wrapper = mount(%3CIncident incident=%7Bincident%7D /%3E);%0A    wrapper.find('GridTile').simulate('click');%0A    wrapper.find(%60.$%7Bstyles.incidentInfo%7D%60).simulate('click');%0A    expect(wrapper.state().showText).to.eql(false);%0A  %7D);
 %0A%7D);%0A

Test toggling state