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

import { getModules } from '~tests/factories/modules/footer-navigation.factory';
import FooterNavigation from '.';

describe('Footer Nav component', () => {
  test('render Nav', () => {
    const { container, getByText } = render(
      <FooterNavigation
        isStorybook={true}
        section={{
          style: 'template_one',
          modules: getModules(),
        }}
      />
    );
    expect(container).toBeTruthy();

    // Default cards
    expect(getByText('Home')).toBeTruthy();
    expect(getByText('Bonus')).toBeTruthy();
    expect(getByText('Casinos')).toBeTruthy();
    expect(getByText('Slots')).toBeTruthy();
    expect(container.querySelectorAll('a')).toHaveLength(4);
    expect(container.querySelectorAll('img')).toHaveLength(4);
  });
});
afterEach(() => {
  cleanup();
});
