detached cd08227

test(daemon): assert floating structural error messages and no chain leak

commit
cd082276e0d48cd4e7dbaea6d8b9ebf155736429
author
brice · · 2026-07-20 17:54 UTC
parent
bdb821c
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +11 -6
M internal/usecase/daemon/floating_test.go +11 -6
@@ -594,12 +594,14 @@ func TestFloatingInstallLogsSessionNameSafelyDuringRename(t *testing.T) {
594594
595595 func TestToggleFloatingStructuralErrorsAreUserErrors(t *testing.T) {
596596 tests := []struct {
597- name string
598- d *Daemon
599- sess *session
597+ name string
598+ d *Daemon
599+ sess *session
600+ wantMsg string
601+ cause error
600602 }{
601- {"nil session", newTestDaemon(t, nil, stubClock{}), nil},
602- {"no active tab", newTestDaemon(t, nil, stubClock{}), &session{}},
603+ {"nil session", newTestDaemon(t, nil, stubClock{}), nil, "couldn't open floating pane: no active session", nil},
604+ {"no active tab", newTestDaemon(t, nil, stubClock{}), &session{}, "couldn't open floating pane: no active tab", layout.ErrNotFound},
603605 }
604606 for _, tc := range tests {
605607 t.Run(tc.name, func(t *testing.T) {
@@ -610,7 +612,10 @@ func TestToggleFloatingStructuralErrorsAreUserErrors(t *testing.T) {
610612 require.ErrorAs(t, err, &ue)
611613 require.Equal(t, domain.NoticeFloatingSpawn, ue.Code)
612614 require.Equal(t, domain.NoticeError, ue.Severity)
613- require.NotEmpty(t, ue.Msg)
615+ require.Equal(t, tc.wantMsg, ue.Msg)
616+ if tc.cause != nil {
617+ require.NotContains(t, ue.Msg, tc.cause.Error())
618+ }
614619 })
615620 }
616621 }
@@ -594,12 +594,14 @@ func TestFloatingInstallLogsSessionNameSafelyDuringRename(t *testing.T) {
594 594
595 func TestToggleFloatingStructuralErrorsAreUserErrors(t *testing.T) {595 func TestToggleFloatingStructuralErrorsAreUserErrors(t *testing.T) {
596 tests := []struct {596 tests := []struct {
597- name string597+ name string
598- d *Daemon598+ d *Daemon
599- sess *session599+ sess *session
600+ wantMsg string
601+ cause error
600 }{602 }{
601- {"nil session", newTestDaemon(t, nil, stubClock{}), nil},603+ {"nil session", newTestDaemon(t, nil, stubClock{}), nil, "couldn't open floating pane: no active session", nil},
602- {"no active tab", newTestDaemon(t, nil, stubClock{}), &session{}},604+ {"no active tab", newTestDaemon(t, nil, stubClock{}), &session{}, "couldn't open floating pane: no active tab", layout.ErrNotFound},
603 }605 }
604 for _, tc := range tests {606 for _, tc := range tests {
605 t.Run(tc.name, func(t *testing.T) {607 t.Run(tc.name, func(t *testing.T) {
@@ -610,7 +612,10 @@ func TestToggleFloatingStructuralErrorsAreUserErrors(t *testing.T) {
610 require.ErrorAs(t, err, &ue)612 require.ErrorAs(t, err, &ue)
611 require.Equal(t, domain.NoticeFloatingSpawn, ue.Code)613 require.Equal(t, domain.NoticeFloatingSpawn, ue.Code)
612 require.Equal(t, domain.NoticeError, ue.Severity)614 require.Equal(t, domain.NoticeError, ue.Severity)
613- require.NotEmpty(t, ue.Msg)615+ require.Equal(t, tc.wantMsg, ue.Msg)
616+ if tc.cause != nil {
617+ require.NotContains(t, ue.Msg, tc.cause.Error())
618+ }
614 })619 })
615 }620 }
616 }621 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close