/* eslint-disable no-multi-assign */
import React from 'react';
import { render, cleanup } from '@testing-library/react';
import MainProvider from '~context/MainProvider';
import '@testing-library/jest-dom/extend-expect';
import TemplateFour from '.';

describe('Author Header', () => {
  test('Template Four', () => {
    const { container, getByText } = render(
      <MainProvider value={{}}>
        <TemplateFour
          author={{
            name: 'Ida Moen Olsen',
            author_title: 'Online Casino Specialist',
            image_object: {
              filename:
                'https://assets-srv.s3.eu-west-1.amazonaws.com/2020-09-25-15-01-46-imagesjpeg-191264.png',
              width: '150',
              height: '150',
            },
            image_alt: 'image-alt',
            facebook_profile: 'https://www.irishluck.ie',
            instagram_profile: 'https://www.irishluck.ie',
            linkedin_profile: 'https://www.irishluck.ie',
            twitter_profile: 'https://www.irishluck.ie',
            tik_tok: 'https://www.irishluck.ie',
            profile_page_path: '/',
          }}
        />
      </MainProvider>
    );
    expect(getByText('Ida Moen Olsen')).toBeTruthy();
    expect(getByText('Online Casino Specialist')).toBeTruthy();
    expect(container.querySelectorAll('a')).toHaveLength(5);
  });
});

afterEach(() => {
  cleanup();
});
