import React from 'react';
import { shallow } from 'enzyme';
import FooterCookieNotice from './footer-cookie-notice';

describe('<FooterCookieNotice />', () => {
  it('should display the default cookie notice message', () => {
    const component = shallow(<FooterCookieNotice />);
    expect(
      component
        .find('p')
        .first()
        .text(),
    )
      .toContain(`To enhance your experience and ensure our website runs smoothly, we use
        cookies and similar technologies.`);
  });

  it('should render a button', () => {
    const component = shallow(<FooterCookieNotice />);
    expect(component.find('Button')).toHaveLength(1);
  });

  it('should display the cookie notice message when the message prop is set', () => {
    const component = shallow(
      <FooterCookieNotice message='this is a test message' />,
    );
    expect(
      component
        .find('p')
        .first()
        .text(),
    ).toContain(`this is a test message`);
  });
});
