/* eslint-disable react/prop-types */
import React from 'react';
import { render } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import LottoUK49 from '.';
import data from '../../../../tests/factories/lotto/lotto-uk-49';

describe('LottoUK49 Component', () => {
  test('renders without crashing with serverData', () => {
    const { getByText } = render(<LottoUK49 serverData={data} />);
    expect(getByText('Draw Date')).toBeTruthy();
    expect(getByText('Lunchtime')).toBeTruthy();
    expect(getByText('Teatime')).toBeTruthy();
    expect(getByText('UK 49s lunchtime Result For Today')).toBeTruthy();
    expect(getByText('UK 49s teatime Result For Today')).toBeTruthy();
  });

  test('renders without data with serverData', () => {
    const { container } = render(<LottoUK49 serverData={[]} />);
    expect(container.firstChild).toBeNull();
  });
});

// need add more tests when we have new APIs
