Back to Repositories

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
tests/runtime/utils/test_system_stats.py
unit
python This Python unit test verifies system statistics collection functionality including CPU, memory, disk, and I/O metrics.
tests/runtime/test_images.py
unit
python This pytest unit test verifies language runtime environments and version compatibility in containerized environments for the OpenHands EventStreamRuntime.
frontend/__tests__/components/browser.test.tsx
unit
typescript This React component unit test verifies the BrowserPanel’s rendering behavior for screenshots and URLs in different states.
frontend/__tests__/components/feedback-form.test.tsx
unit
typescript This Jest unit test verifies the rendering, permission toggling, and closure functionality of a React feedback form component.
frontend/__tests__/components/user-actions.test.tsx
unit
typescript This Jest unit test verifies UserActions component functionality including menu toggling, account settings, and logout operations.
frontend/__tests__/components/context-menu/account-settings-context-menu.test.tsx
unit
typescript This Jest unit test verifies the functionality and interaction handling of the AccountSettingsContextMenu component including authentication states and click events.
frontend/__tests__/components/context-menu/context-menu-list-item.test.tsx
unit
typescript This Jest unit test verifies the rendering and interaction behavior of the ContextMenuListItem component including click handling and disabled states.
frontend/__tests__/components/file-explorer/explorer-tree.test.tsx
unit
typescript This Jest unit test verifies the rendering and expansion behavior of the ExplorerTree React component for file system navigation.
frontend/__tests__/components/image-preview.test.tsx
unit
typescript This Jest unit test verifies the rendering and interaction behavior of the ImagePreview React component.
frontend/__tests__/components/jupyter/jupyter.test.tsx
unit
typescript This Jest unit test verifies the JupyterEditor component’s scrollable container implementation and Redux store integration.