Problem
The project has only a single smoke test. The core chatbot logic (message handling, prompt construction, streaming) has no test coverage.
Proposed Solution
- Add unit tests for the
Chatbot component's message flow
- Test the prompt construction logic (knowledge base + user message)
- Test error handling (API failures, network errors)
- Test the loading state and streaming behavior
- Use MSW (Mock Service Worker) or manual fetch mocks for API calls
Problem
The project has only a single smoke test. The core chatbot logic (message handling, prompt construction, streaming) has no test coverage.
Proposed Solution
Chatbotcomponent's message flow