🧪 Add Unit Tests for useTodos Hook
📋 Overview
Create comprehensive unit tests for the useTodos custom hook to ensure all CRUD operations, error handling, and state management work correctly.
🎯 Acceptance Criteria
🔧 Technical Requirements
- Use Jest + React Testing Library
- Mock fetch API calls
- Test both success and error scenarios
- TypeScript support for test files
🚫 Out of Scope
- Integration tests with real API
- Component integration testing
- End-to-end testing scenarios
- Performance testing
- Testing Next.js specific features
📚 Resources
💡 Testing Tips
- Test one function at a time
- Always test both happy and unhappy cases
- Use descriptive test names
- Mock external dependencies
🧪 Add Unit Tests for useTodos Hook
📋 Overview
Create comprehensive unit tests for the
useTodoscustom hook to ensure all CRUD operations, error handling, and state management work correctly.🎯 Acceptance Criteria
hooks/use-todos.spec.tsis createdaddTodo,updateTodo,toggleTodo,deleteTodonpm test🔧 Technical Requirements
🚫 Out of Scope
📚 Resources
💡 Testing Tips