test:Add unit test cases for App.tsx and index.tsx pages
Task Overview
Write unit test cases for the following pages in the Viswam Website project:
- src/pages/App.tsx
- src/pages/index.tsx
Objective
Improve test coverage for page-level components by ensuring proper rendering, routing, and behavior validation.
✅ Requirements
- Use Vitest and React Testing Library
- Follow existing test patterns from:
- Home.test.tsx
- AIHackdays.test.tsx
🧪 Test Cases to Cover
-
Rendering:
- Component renders without crashing
- Important headings/text are visible
-
Routing:
- Navigation works correctly (if applicable)
- Links render properly
-
Conditional Rendering:
- Loading state (if present)
- Empty data state
- Data display state
-
Interactions:
- Button clicks (if any)
- Navigation triggers
-
Edge Cases:
- Empty API response
- Error handling (if API is used)
📂 Output
Create test files in: src/tests/pages/
- App.test.tsx
- Index.test.tsx
⚙ ️ Notes
- Mock API calls and router where needed
- Ensure no TypeScript errors
- Tests should pass using: npm test -- --run