diff --git a/src/pages/Index.test.tsx b/src/pages/Index.test.tsx deleted file mode 100644 index 1d9cb84b..00000000 --- a/src/pages/Index.test.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { describe, it, expect } from 'vitest'; -import { render, screen } from '@testing-library/react'; -import Index from './Index'; -import { TestApp } from '@/test/TestApp'; - -describe('Index Page', () => { - it('renders index page with project description textarea', () => { - render( - - - - ); - - expect(screen.getByPlaceholderText('Please select a model below, then describe what you\'d like to build...')).toBeInTheDocument(); - expect(screen.getByRole('button', { name: /Create Project/i })).toBeInTheDocument(); - }); - - it('disables create button when no prompt is provided', () => { - render( - - - - ); - - const createButton = screen.getByRole('button', { name: /Create Project/i }); - expect(createButton).toBeDisabled(); - }); - - it('shows FileAttachment component for file management', () => { - render( - - - - ); - - // Query the paperclip button by test id or aria label - const paperclipButton = screen.getByTestId('paperclip-button'); - expect(paperclipButton).toBeInTheDocument(); - expect(paperclipButton).toHaveAttribute('aria-label', 'Attach files'); - }); - - it('shows FileAttachment component by role and name', () => { - render( - - - - ); - - // Query the paperclip button by role and aria-label - const paperclipButton = screen.getByRole('button', { name: /attach files/i }); - expect(paperclipButton).toBeInTheDocument(); - }); - - it('has textarea container that can receive drag events', () => { - render( - - - - ); - - const textarea = screen.getByPlaceholderText('Please select a model below, then describe what you\'d like to build...'); - const container = textarea.closest('div'); - - expect(container).toBeInTheDocument(); - - // Verify the container can handle drag events by checking if it's interactive - expect(container).toHaveClass('relative', 'rounded-2xl', 'border', 'border-input'); - }); - - it('enables create button when text prompt is provided and model is selected', async () => { - const user = await import('@testing-library/user-event').then(mod => mod.userEvent); - - render( - - - - ); - - // Type in the textarea - const textarea = screen.getByPlaceholderText('Please select a model below, then describe what you\'d like to build...'); - await user.type(textarea, 'Create a test project'); - - // The create button should be enabled once we have text - const createButton = screen.getByRole('button', { name: /Create Project/i }); - // Note: In actual test environment, the button might still be disabled due to model selection - // This test mainly verifies the component structure and basic interactivity - expect(createButton).toBeInTheDocument(); - }); -}); \ No newline at end of file