Add tests: tui/shared, tui/app, and e2e integration suite - #4
Merged
Conversation
- internal/tui/shared: unit tests for IsQuit, screen/key constants, RenderHeader - internal/tui/app: BubbleTea model tests for New, NewPickerApp, Update message routing (CtrlC, ErrorMsg, LaunchProfile, WindowSize, screen switches, DeleteProfile), and View rendering - test/integration: e2e CLI tests that build the jig binary in TestMain and exercise all commands (init, profiles create/list/show/validate/export/delete, doctor, run --dry-run) via subprocess with isolated HOME and working directories Closes all identified test gaps: cmd/jig, internal/tui/app.go, internal/tui/shared Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
internal/tui/shared— unit tests forIsQuit, screen/key constants, andRenderHeader(19 tests across 2 files)internal/tui/app— BubbleTea model tests for constructors, allUpdatemessage routing (CtrlC, ErrorMsg, LaunchProfile, WindowSize, screen switches, DeleteProfile), andViewrendering (18 tests)test/integration— new e2e CLI suite that builds thejigbinary inTestMainand exercises every command as a subprocess with isolatedHOMEand working directories (27 tests)Commands covered by integration tests
jig init(fresh dir + already-initialized)jig profiles create / list / show / validate / export / deletejig doctor(with and without aclaudebinary onPATHvia fake shell script)jig run --dry-run(profile found, not found, typo suggestion, missing args)Test plan
go test ./internal/tui/shared/...— 19 tests passgo test ./internal/tui/...— 18 new + existing tests passgo test ./test/integration/... -v— 27 tests passgo test ./...— full suite green🤖 Generated with Claude Code