import React from 'react';
import { render } from '@testing-library/react';
import OperatorSummary from '.';

const mockPage = {
  reviewer: {},
  relation_type: 'operator',
  extra_fields: {},
  template: 'operator',
  relation: {
    name: 'Rizk',
    logo_url: 'logo.png',
    status: 'active',
  },
};

test('renders with default props', () => {
  const { getByText, getByAltText } = render(<OperatorSummary page={mockPage} />);

  expect(getByText('Expert Casino Review')).toBeInTheDocument();
  expect(getByAltText('Rizk')).toBeInTheDocument();
});

test('renders with custom props', () => {
  const { getByText, getByAltText } = render(
    <OperatorSummary page={mockPage} imgWidth={200} imgHeight="200px" />
  );

  expect(getByText('Expert Casino Review')).toBeInTheDocument();
  expect(getByAltText('Rizk')).toBeInTheDocument();
  expect(document.querySelector('.description')).not.toBeInTheDocument();
});
