diff --git a/docs/02-testing/e2e-test-analysis.md b/docs/02-testing/e2e-test-analysis.md index f16b283..9482606 100644 --- a/docs/02-testing/e2e-test-analysis.md +++ b/docs/02-testing/e2e-test-analysis.md @@ -48,7 +48,7 @@ Actual UI Structure (from error-context.md): - Welcome Screen: - img - heading "Welcome to DocuNote" [level=2] - - paragraph: "Upload a TXT or PDF file and start asking questions..." + - paragraph: "Upload documents (.txt, .pdf, .docx, .md, .csv) or add website URLs..." - Input Area: - textbox "Ask a question about your document(s)..." - button "Send message" [disabled] @@ -91,8 +91,8 @@ Actual UI Structure (from error-context.md): #### Chat Functionality Tests (20 failures) - **Test:** "should show empty state without sources" - **Expected:** Text matching `/upload files or add urls/i` - - **Actual:** Shows "Upload a TXT or PDF file and start asking questions..." - - **Fix Needed:** Update text matcher to actual welcome message + - **Actual:** Shows "Upload documents (.txt, .pdf, .docx, .md, .csv) or add website URLs..." + - **Fix Needed:** ✅ FIXED - Updated text matcher to actual welcome message - **Test:** "should not allow empty message submission" - **Expected:** `input[placeholder*="Ask"]` @@ -170,7 +170,7 @@ Both test suites suffer from the **same root cause**: **Test Expected:** "upload files or add urls" text **Screenshot Shows:** - Welcome heading: "Welcome to DocuNote" -- Description: "Upload a TXT or PDF file and start asking questions to get insights from your document." +- Description: "Upload documents (.txt, .pdf, .docx, .md, .csv) or add website URLs to start asking questions and get insights from your content." - Input field visible but disabled until files added - Sidebar visible with "No URLs added" and "No files added" messages @@ -196,7 +196,7 @@ Both test suites suffer from the **same root cause**: - `input[type="file"]` → Click "Add Files" button, then use hidden input 2. Update expected text: - - `/upload files or add urls/i` → `/Upload a TXT or PDF file/i` + - ✅ FIXED: Updated to `/Upload documents.*or add website URLs/i` to match actual welcome message 3. Skip theme tests (or update if Settings has theme toggle) diff --git a/e2e/chat-functionality.spec.ts b/e2e/chat-functionality.spec.ts index 7dc1f3c..19b6791 100644 --- a/e2e/chat-functionality.spec.ts +++ b/e2e/chat-functionality.spec.ts @@ -15,7 +15,7 @@ test.describe('Chat Functionality', () => { }); test('should show empty state without sources', async ({ page }) => { - await expect(page.locator('text=/Upload a TXT or PDF file/i')).toBeVisible(); + await expect(page.locator('text=/Upload documents.*or add website URLs/i')).toBeVisible(); }); test('should not allow empty message submission', async ({ page }) => { diff --git a/src/__tests__/app/page.test.tsx b/src/__tests__/app/page.test.tsx index 66b50f6..0072e86 100644 --- a/src/__tests__/app/page.test.tsx +++ b/src/__tests__/app/page.test.tsx @@ -102,7 +102,7 @@ describe('Main Page Component', () => { it('should show upload prompt when no files uploaded', () => { renderPage(); - expect(screen.getByText(/Upload a TXT or PDF file/i)).toBeInTheDocument(); + expect(screen.getByText(/Upload documents.*\.txt.*\.pdf.*\.docx.*\.md.*\.csv/i)).toBeInTheDocument(); }); }); diff --git a/src/__tests__/components/chat-messages.test.tsx b/src/__tests__/components/chat-messages.test.tsx index 1b6a82c..b75a51c 100644 --- a/src/__tests__/components/chat-messages.test.tsx +++ b/src/__tests__/components/chat-messages.test.tsx @@ -17,7 +17,7 @@ describe('ChatMessages', () => { render(); expect(screen.getByText(/Welcome to DocuNote/i)).toBeInTheDocument(); - expect(screen.getByText(/Upload a TXT or PDF file/i)).toBeInTheDocument(); + expect(screen.getByText(/Upload documents.*\.txt.*\.pdf.*\.docx.*\.md.*\.csv/i)).toBeInTheDocument(); }); it('renders prompt to ask questions when files exist but no messages', () => { diff --git a/src/components/chat-messages.tsx b/src/components/chat-messages.tsx index 63066aa..a78bd08 100644 --- a/src/components/chat-messages.tsx +++ b/src/components/chat-messages.tsx @@ -93,7 +93,7 @@ export function ChatMessages({

Welcome to DocuNote

- {hasFiles ? 'Your files are ready. Ask a question to get started.' : 'Upload a TXT or PDF file and start asking questions to get insights from your document.'} + {hasFiles ? 'Your files are ready. Ask a question to get started.' : 'Upload documents (.txt, .pdf, .docx, .md, .csv) or add website URLs to start asking questions and get insights from your content.'}

);