import * as React from 'react'; import { shallow, mount } from 'enzyme'; import BenefitsBar from '.'; import 'jest-styled-components'; describe('BenefitsBar component', () => { test('renders', () => { const wrapper: any = shallow(); expect(wrapper).toMatchSnapshot(); }); test('the label text is equal to `Free shipping on orders over £100.00 with free returns`', () => { const wrapper = mount( Free shipping on orders over £100.00 with free returns ); expect(wrapper.text()).toEqual('Free shipping on orders over £100.00 with free returns'); }); test('the background color is equal to `black`', () => { const wrapper = mount( Free shipping on orders over £100.00 with free returns ); expect(wrapper).toHaveStyleRule('background-color', '#000000'); }); test('the color is equal to `white`', () => { const wrapper = mount( Free shipping on orders over £100.00 with free returns ); expect(wrapper).toHaveStyleRule('color', '#FFFFFF'); }); });