pi-agent: Fix final integrated review
This commit is contained in:
@@ -46,6 +46,37 @@ func TestCompleteModelRendersResponsiveTerminalSizeClasses(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestCompleteModelWideLayoutUsesOriginalTerminalBoundary(t *testing.T) {
|
||||
module := responsiveLayoutModule()
|
||||
|
||||
for _, test := range []struct {
|
||||
name string
|
||||
width int
|
||||
height int
|
||||
wantWide bool
|
||||
expandError bool
|
||||
}{
|
||||
{name: "one row below height boundary", width: 100, height: 27},
|
||||
{name: "exact boundary", width: 100, height: 28, wantWide: true},
|
||||
{name: "expanded error does not change exact boundary", width: 100, height: 28, wantWide: true, expandError: true},
|
||||
} {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
model := resizedModel(t, module, themeModeNoColor, test.width, test.height)
|
||||
if test.expandError {
|
||||
model.operation.currentError = &operationError{
|
||||
status: app.OperationStatus{Kind: app.StatusError, Summary: "Target update failed"},
|
||||
detail: strings.Repeat("expanded diagnostic line\n", 20),
|
||||
}
|
||||
model.operation.errorExpanded = true
|
||||
}
|
||||
view := model.View()
|
||||
if got := sameLine(view, "Targets", "Target details"); got != test.wantWide {
|
||||
t.Fatalf("side-by-side = %v, want %v at %dx%d (expanded=%v):\n%s", got, test.wantWide, test.width, test.height, test.expandError, view)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestCompleteModelResizePreservesValidSelectionAndFormFocus(t *testing.T) {
|
||||
module := responsiveLayoutModule()
|
||||
model := resizedModel(t, module, themeModeNoColor, 120, 36)
|
||||
|
||||
Reference in New Issue
Block a user