/* 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 '../../../../../../../tests/factories/pages/operator.factory';
import TemplateOneTwo from '.';

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

  test('Template One Status Active', () => {
    const { container, getByText } = render(<TemplateOneTwo {...data} />);
    expect(getByText('Ice Casino')).toBeTruthy();
    expect(container.querySelectorAll('h1')).toHaveLength(1);
    expect(getByText('New')).toBeTruthy();
    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(6);
  });

  test('Template Two Status Active', () => {
    const { container, getByText } = render(<TemplateOneTwo {...data} template="template_two" />);
    expect(getByText('Ice Casino')).toBeTruthy();
    expect(container.querySelectorAll('h1')).toHaveLength(1);
    expect(getByText('New')).toBeTruthy();
    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(6);
  });
});

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