import React from 'react';
import { render, screen } from '@testing-library/react';
import Loader from '../components/Loader.js';
import '@testing-library/jest-dom';

describe('Loader Component', () => {
  it('renders the loader with role status', () => {
    render(<Loader />);
    const loader = screen.getByRole('status');
    expect(loader).toBeInTheDocument();
    expect(loader).toHaveClass('loader');
  });

  it('contains the spinner element', () => {
    render(<Loader />);
    const spinner = screen.getByRole('status').querySelector('.spinner');
    expect(spinner).toBeInTheDocument();
  });
});
