import React from 'react'; import { shallow, mount } from 'enzyme'; import HeadlineSubHeading from '.'; import 'jest-styled-components'; const props = { heading: 'The classic collection', subHeading: 'Our original and most refined cycle clothing collection, Classic is made with carefully selected materials for those who refuse to choose between performance and style.' }; describe('Headline & Sub Heading', () => { test('renders', () => { const wrapper = shallow(); expect(wrapper).toMatchSnapshot(); }); test('it applies default styles', () => { const wrapper = mount(); expect(wrapper).toHaveStyleRule('display', 'flex'); expect(wrapper).toHaveStyleRule('margin', '64px'); expect(wrapper).toHaveStyleRule('flex-direction', 'column'); expect(wrapper).toHaveStyleRule('text-align', 'center'); }); test('renders with no date', () => { const wrapper = mount(); expect(wrapper).toMatchSnapshot(); }); });