OpenHands Testing: Jest & Pytest Implementation for Full-Stack Applications
The OpenHands repository demonstrates a comprehensive testing approach utilizing both Jest and Pytest frameworks for thorough unit testing coverage. With over 100 test cases, the codebase showcases modern testing practices across frontend React components and backend Python modules, ensuring robust validation of core functionalities like prompt management, UI interactions, and terminal operations. Qodo Tests Hub provides developers with an organized view into OpenHands' testing patterns, making it easier to understand how different components are tested in a real-world application. Through the hub's interactive interface, developers can explore test implementations for specific features, analyze testing strategies for both frontend and backend components, and learn practical approaches to writing effective unit tests for similar applications.
Path | Test Type | Language | Description |
---|---|---|---|
evaluation/regression/cases/hello-world/test_hello_world.py |
unit
|
python | This pytest unit test verifies Hello World bash script generation and execution across multiple AI agents. |
frontend/__tests__/components/chat-message.test.tsx |
unit
|
typescript | This Jest unit test verifies the ChatMessage component’s rendering, interaction, and functionality including message display, clipboard operations, and code formatting. |
frontend/__tests__/components/chat/chat-input.test.tsx |
unit
|
typescript | This Jest unit test verifies ChatInput component functionality including message submission, validation, and paste handling in React. |
frontend/__tests__/components/chat/chat-interface.test.tsx |
unit
|
typescript | This Jest unit test verifies the ChatInterface component’s functionality including message handling, UI interactions, and WebSocket communication in the OpenHands project. |
frontend/__tests__/components/chat/expandable-message.test.tsx |
unit
|
typescript | This Jest unit test verifies the ExpandableMessage component’s rendering behavior, styling, and status indication across different message types and states. |
frontend/__tests__/components/features/waitlist-modal.test.tsx |
unit
|
typescript | This Jest unit test verifies the waitlist modal component’s checkbox behavior, GitHub button state management, and user consent capture functionality. |
frontend/__tests__/components/feedback-actions.test.tsx |
unit
|
typescript | This Jest unit test verifies the rendering and interaction handling of the FeedbackActions React component. |
frontend/__tests__/components/file-explorer/file-explorer.test.tsx |
unit
|
typescript | This Jest unit test verifies FileExplorer component functionality including directory navigation, file operations, and error handling in the OpenHands application. |
frontend/__tests__/components/file-explorer/tree-node.test.tsx |
unit
|
typescript | This Jest unit test verifies TreeNode component functionality in a file explorer, including file rendering, folder navigation, and API integration. |
frontend/__tests__/components/interactive-chat-box.test.tsx |
unit
|
typescript | This React Testing Library unit test verifies the InteractiveChatBox component’s message submission and image upload functionality. |