Better interactive mode tests#112
Merged
Merged
Conversation
…ive tests Add toggle_item() for MultiSelect prompts that sends space instead of enter. Unlike select_item() which targets Select prompts (cursor starts hidden), toggle_item() accounts for MultiSelect's cursor starting at item 0. Rewrite the add command interactive test module with assert_screen() validation, semantic interaction methods, and cancellation tests at every interactive state.
…ackages commands - Rewrite add command interactive tests with assert_screen at every step - Add cancellation tests using ESC (for Select prompts) and Ctrl+C (for text inputs) - Add interactive tests for additional-packages add/remove/edit commands - Add toggle_item() and ctrl_c() methods to TerminalSession - Reduce KEY_DELAY from 50ms to 10ms (dialoguer handles keystrokes fast enough)
Cover all interactive flows with full assert_screen validation at every prompt: action menu rendering, cancellation at each state, add/remove operations, prerelease graduation, and empty-state messaging.
…mand tests Increase virtual terminal to 1200x400 with no scrollback so all output is visible without scrolling. Replace all assert_screen_starts_with and assert_screen_ends_with usages with assert_screen, embedding dynamic temp dir paths via canonicalize() + format!(). Remove the now-unused partial assertion methods from TerminalSession.
ESC at any prompt during `cargo changeset init` now aborts the entire operation instead of silently skipping the current section and continuing to the next prompt. This fixes 7 interactive tests that were timing out at 30 seconds because the process blocked on subsequent prompts after ESC was treated as "skip".
The terminal_session module is incompatible with Windows. Imports for TerminalSession, PathBuf, and indoc were at file top level causing compilation failure on Windows CI. Moved them into the cfg-gated modules that actually use them, matching the pattern in add_command.rs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.