/* eslint-disable no-restricted-syntax */
/* eslint-disable no-multi-assign */
import React from 'react';
import { render, cleanup } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import getOperatorData from 'gatsby-core-theme/tests/factories/relations/operator.factory';
import TemplateFour from '.';

describe('Operator template four component', () => {
  const data = getOperatorData();

  test('Template Four Status Active', () => {
    const { container, getByText } = render(<TemplateFour {...data} type='operator' />);
    expect(getByText('Ice Casino')).toBeTruthy();
    expect(container.querySelectorAll('h1')).toHaveLength(1);
    expect(container.querySelectorAll('a')).toHaveLength(3);
    expect(getByText('100% Bonus')).toBeTruthy();
    expect(getByText('+ Big Promotions')).toBeTruthy();
    expect(container.querySelectorAll('ul')).toHaveLength(1);
    expect(container.querySelectorAll('li')).toHaveLength(7);
  });
});

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