UNPKG

@shopgate/engage

Version:
39 lines 954 B
/* eslint-disable require-jsdoc */ import React from 'react'; import { shallow } from 'enzyme'; import ProductSlider from "./index"; import { jsx as _jsx } from "react/jsx-runtime"; jest.mock('@shopgate/engage/core', () => ({ useWidgetSettings: jest.fn() })); jest.mock('@shopgate/engage/components', () => { const Swiper = ({ children }) => children; Swiper.Item = ({ children }) => children; Swiper.Item.displayName = 'Swiper.Item'; return { Swiper }; }); jest.mock('@shopgate/engage/core/hooks', () => { const ProductCard = props => /*#__PURE__*/_jsx(ProductCard, { ...props }); return { useThemeComponents: () => ({ ProductCard }) }; }); describe('<ProductSlider />', () => { it('should match snapshot', () => { const wrapper = shallow(/*#__PURE__*/_jsx(ProductSlider, { productIds: ['prod1'] })); expect(wrapper).toMatchSnapshot(); }); }); /* eslint-enable require-jsdoc */