test(tui): add tests for diff viewer in tui - #13072
Merged
Merged
Conversation
This was referenced Mar 27, 2026
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds snapshot-based tests for the legacy status TUI “details/diff” viewer by introducing a terminal-buffer-to-SVG renderer and committing the resulting SVG snapshots.
Changes:
- Add
details_testsmodule with snapshot tests covering toggling details, selection updates, scrolling, wrapping, and multi-hunk rendering. - Extend TUI test utilities with SVG rendering/assertion helpers for
ratatui::backend::TestBackend. - Add SVG snapshot artifacts for the new details/diff viewer test cases.
Reviewed changes
Copilot reviewed 3 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/but/src/command/legacy/status/tui/tests/utils.rs | Adds assert_rendered_term_svg_eq and SVG rendering helpers for snapshot assertions. |
| crates/but/src/command/legacy/status/tui/tests/mod.rs | Registers the new details_tests module. |
| crates/but/src/command/legacy/status/tui/tests/details_tests.rs | Introduces new snapshot tests for details/diff viewer behavior. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/toggling_details_off_and_on_resets_scroll_position_003.svg | New SVG snapshot for scroll reset behavior. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/toggle_details_view_for_commit_003.svg | New SVG snapshot for details toggle sequence. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/toggle_details_view_for_commit_001.svg | New SVG snapshot for details toggle sequence. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/details_view_updates_with_selection_changes_001.svg | New SVG snapshot validating details updates on selection changes. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_message_wraps_in_details_view_003.svg | New SVG snapshot validating commit message wrapping in details pane. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_message_wraps_in_details_view_002.svg | New SVG snapshot validating commit message wrapping in details pane. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_message_wraps_in_details_view_001.svg | New SVG snapshot validating commit message wrapping in details pane. |
davidpdrsn
force-pushed
the
dp-move-mode
branch
from
March 27, 2026 17:47
0f5fdad to
500061b
Compare
davidpdrsn
force-pushed
the
dp-tui-diff-tests
branch
from
March 27, 2026 18:14
eecf12b to
bd2cb4b
Compare
davidpdrsn
enabled auto-merge
March 27, 2026 18:15
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.
This is part 2 of 4 in a stack made with GitButler:
Modeand related types into their own module #13063DebugAsTypeinto its own module #13062