diff --git a/src/frontend/js/product/ProductItem.spec.js b/src/frontend/js/product/ProductItem.spec.js index d8f17fd7..5daa8d65 100644 --- a/src/frontend/js/product/ProductItem.spec.js +++ b/src/frontend/js/product/ProductItem.spec.js @@ -1,13 +1,11 @@ -import chai, { assert } from 'chai'; +import { assert } from 'chai'; import { shallow } from 'enzyme'; -import chaiEnzyme from 'chai-enzyme'; import React from 'react'; +import { Link } from 'react-router'; import '../test/setupJsdom'; import ProductItem from './ProductItem'; -chai.use(chaiEnzyme()); - describe('Component ProductItem', () => { const props = { id: 42, @@ -34,6 +32,16 @@ describe('Component ProductItem', () => { it('should display the correct thumbnail', () => { const wrapper = shallow(); - assert.deepEqual(wrapper.find('img').node.props.src, 'http://google.fr/image.jpg'); + assert.deepEqual(wrapper.find('img').prop('src'), 'http://google.fr/image.jpg'); + }); + + it('should contain correct product details link', () => { + const wrapper = shallow(); + assert(wrapper.contains(Details)); + }); + + it('should contain correct order link', () => { + const wrapper = shallow(); + assert(wrapper.contains(Order)); }); });