import { render, screen } from '@testing-library/react'
import { describe, it, expect } from 'vitest'
import { MemoryRouter } from 'react-router'
import Home from './home'

describe('Home component', () => {
  it('should render task management interface', () => {
    const mockLoaderData = { tasks: [] }
    render(
      <MemoryRouter>
        <Home loaderData={mockLoaderData} />
      </MemoryRouter>
    )
    expect(
      screen.getByRole('heading', { level: 1, name: /Tasks/i })
    ).toBeInTheDocument()

    // TaskList component should be rendered with empty state
    expect(screen.getByText(/No tasks found/i)).toBeInTheDocument()
  })
})
