Skip to content

Instantly share code, notes, and snippets.

@FermiDirak
Created March 6, 2018 01:10
Show Gist options
  • Save FermiDirak/3aff3c0ebeb29448fd3e3b03eac1e50f to your computer and use it in GitHub Desktop.
Save FermiDirak/3aff3c0ebeb29448fd3e3b03eac1e50f to your computer and use it in GitHub Desktop.
import React from 'react';
import { shallowToJson } from 'enzyme-to-json';
import { CarouselImage } from './../../client/src/components/CarouselImage.jsx';
describe('<CarouselImage/>', () => {
let component = shallow(<CarouselImage/>);
it('should render', () => {
expect(shallowToJson(component)).toMatchSnapshot();
});
it('should be hoverable', () => {
expect(component.state().hover).toEqual(false);
component.simulate('mouseOver');
expect(component.state().hover).toEqual(true);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment