Files
pipelines/internal/tui/notification_setup_test.go
alan c42a19f7d3 Improve workflow UI, retain stage diffs, and add portable pipeline transfers
Make OpenCode authoring responsive and expand the managed skill references. Add conflict-aware import/export, real-provider reference workflows, and tracked V2 generation for reliable budget accounting.
2026-10-10 20:55:42 +01:00

40 lines
1.4 KiB
Go

package tui
import (
"context"
"git.a-wan.net/alan/pipelines/internal/protocol"
"github.com/charmbracelet/x/ansi"
"strings"
"testing"
)
func TestInfrastructureRetainedWithoutClutteringPageHeaders(t *testing.T) {
m := New(context.Background(), "ws://localhost/connect")
m.width = 120
m.height = 40
updated, _ := m.Update(receivedMsg(protocol.Message{Type: protocol.PipelineList, NotificationEndpoints: []protocol.NotificationEndpoint{{Destination: "system", ServerURL: "http://10.0.0.249:8090", Topic: "pipelines"}}}))
m = updated.(Model)
view := ansi.Strip(m.View())
header := strings.Split(view, "\n")[0]
for _, text := range []string{"ntfy", "http://10.0.0.249:8090", "topic pipelines"} {
if strings.Contains(header, text) {
t.Fatal("infrastructure cluttered the result page header", text, view)
}
}
if strings.Contains(strings.Join(m.homeLines(), "\n"), "Phone notifications") {
t.Fatal("notification setup still occupies home panel")
}
m.runOpen = true
if strings.Contains(strings.Split(ansi.Strip(m.View()), "\n")[0], "topic pipelines") || len(m.notificationEndpoints) != 1 || m.notificationEndpoints[0].Topic != "pipelines" {
t.Fatal("notification information lost or leaked into run header")
}
for _, width := range []int{1, 12, 40, 80, 120} {
m.width = width
for _, line := range strings.Split(m.View(), "\n") {
if ansi.StringWidth(line) > width {
t.Fatalf("header/layout overflows at width %d", width)
}
}
}
}