import React from 'react';
import { render, cleanup } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';

import InfoGrid from '.';
import getInfoGrids from '~tests/factories/modules/info-grid';

describe('InfoGrid Component', () => {
  test('render with props', () => {
    const { container, getByText } = render(<InfoGrid data={getInfoGrids('hello', 'val', 12)} />);
    expect(container.querySelector('.infoGridContainer')).toBeTruthy();
    expect(container.querySelectorAll('.infoGridItem')).toHaveLength(12);
    expect(getByText('hello-1')).toBeTruthy();
    expect(getByText('val-12')).toBeTruthy();
  });
});
afterEach(() => {
  cleanup();
});
