/**
* External dependencies
*/
import renderer from 'react-test-renderer';
/**
* Internal dependencies
*/
import { ProductPreview } from '../legacy/products-block';
describe( 'ProductPreview', () => {
test( 'should render a single product preview with an image', () => {
const product = {
id: 1,
name: 'Winter Jacket',
price_html:
'$65.00',
images: [
{
src: 'https://example.local/product.jpg',
},
],
};
const component = renderer.create( );
expect( component.toJSON() ).toMatchSnapshot();
} );
test( 'should render a single product preview without an image', () => {
const product = {
id: 1,
name: 'Winter Jacket',
price_html:
'$65.00',
images: [],
};
const component = renderer.create( );
expect( component.toJSON() ).toMatchSnapshot();
} );
} );