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

import { getListCarouselItem } from '~tests/factories/modules/carousel.factory';
import '~tests/helpers/match-media.mock';
import Carousel from '.';

const module = getListCarouselItem(2);

describe('Carousel Component', () => {
  test('render slides', () => {
    const { container } = render(<Carousel module={module} />);
    expect(container.querySelectorAll('.title')).toHaveLength(3);
    expect(container.querySelectorAll('.label')).toHaveLength(3);
  });
});
afterEach(() => {
  cleanup();
});
