import React from 'react';
import { screen, render } from '@testing-library/react';

import { SkeletonList } from './SkeletonList';

describe('SkeletonList', () => {
  it('Should render the skeleton list', async () => {
    render(<SkeletonList itemCount={17} />);

    expect(screen.getByLabelText('Skeleton loader list')).toBeInTheDocument();
  });

  it('Should list out the amount of items we set as the count', async () => {
    render(<SkeletonList itemCount={5} />);

    expect(screen.getAllByRole('listitem')).toHaveLength(5);
  });
});
