Skip to content

Add javascript unit tests for RobotDashboard#229

Open
timdegroot1996 wants to merge 24 commits intomainfrom
js-unit-tests
Open

Add javascript unit tests for RobotDashboard#229
timdegroot1996 wants to merge 24 commits intomainfrom
js-unit-tests

Conversation

@timdegroot1996
Copy link
Copy Markdown
Collaborator

@timdegroot1996 timdegroot1996 commented Mar 28, 2026

Added an initital version of javascript unit tests.
And refactored the other tests to be more streamlined.

Implements #231

- Created `test_robotdashboard.py` to cover various functionalities of the RobotDashboard class, including initialization, output processing, and dashboard creation.
- Implemented tests for handling outputs, including error scenarios for invalid XML and duplicate logs.
- Added tests for the `print_runs`, `remove_outputs`, and `create_dashboard` methods to ensure correct behavior under different configurations.
- Developed `test_server.py` to test the ApiServer class and its FastAPI endpoints, utilizing MagicMock for the RobotDashboard instance.
- Covered authentication, output addition, log management, and error handling in the server tests.
- Ensured comprehensive coverage of both successful and failure scenarios for all endpoints.
- Implement tests for `build_tooltip_meta`, `lookup_tooltip_meta`, and `format_status` functions in `tooltip_helpers.test.js`.
- Create tests for merging logic in `localstorage.test.js`, including deep merging and nested settings.
- Introduce mock data and configurations for testing in `mocks` directory.
- Add scripts for running tests using Vitest.
- Configure Vitest with aliases and test environment settings in `vitest.config.js`.
@timdegroot1996 timdegroot1996 changed the title Js unit tests Add javascritp unit tests for RobotDashboard Mar 28, 2026
@timdegroot1996 timdegroot1996 changed the title Add javascritp unit tests for RobotDashboard Add javascript unit tests for RobotDashboard Mar 28, 2026
- Removed outdated testing documentation for unit tests and Robot Framework tests.
- Added new documentation for JavaScript unit tests, including setup, structure, and mocking patterns.
- Updated Python unit tests documentation to clarify usage and structure.
- Introduced a new Robot Framework tests documentation to outline test execution and dependencies.
- Adjusted package-lock.json to include project name and updated dependencies.
- Deleted test_robotdashboard.py, which contained unit tests for the RobotDashboard class, including tests for initialization, output processing, and dashboard creation.
- Deleted test_server.py, which included unit tests for the ApiServer class and its FastAPI endpoints, covering authentication, output handling, and log management.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant