Skip to content

test(tui): add Ratatui app coverage#102

Draft
alxhall wants to merge 1 commit intoponbac:masterfrom
alxhall:feat/toki-tui-testing
Draft

test(tui): add Ratatui app coverage#102
alxhall wants to merge 1 commit intoponbac:masterfrom
alxhall:feat/toki-tui-testing

Conversation

@alxhall
Copy link
Collaborator

@alxhall alxhall commented Mar 6, 2026

This pull request significantly improves the test coverage and reliability of the toki-tui crate by introducing comprehensive unit and integration tests across the application's core modules. It also adds a new test_support module to provide reusable test helpers, and updates the documentation to guide contributors on running the test suite.

Testing and test infrastructure improvements:

  • Added a new test_support module (toki-tui/src/test_support.rs) containing helpers for creating test data and initializing the app, projects, activities, time entries, and timers. This module is now included in the crate for use in tests. [1] [2]
  • Updated the README.md with a new "Testing" section explaining how to run the TUI test suite and what areas the tests cover.

Expanded test coverage:

  • Added a comprehensive suite of unit tests to toki-tui/src/app/mod.rs for core app behaviors, including timer state transitions, project/activity filtering, note editing, and task export parsing.
  • Introduced tests for the text input component in toki-tui/src/app/state.rs, covering UTF-8 handling and cursor movement.
  • Added tests for runtime actions in toki-tui/src/runtime/actions.rs, including starting/stopping timers, saving/cancelling actions, and deleting entries, with both synchronous and asynchronous scenarios.
  • Implemented focused UI rendering assertions in toki-tui/src/ui/mod.rs to verify that key UI states and overlays render as expected, including timer display, project/activity info, status messages, and masked password fields.

@vercel
Copy link

vercel bot commented Mar 6, 2026

@alxhall is attempting to deploy a commit to the ponbac's projects Team on Vercel.

A member of the Team first needs to authorize it.

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