detached 00f573e

test(client): avoid fatal assertions in send callbacks

commit
00f573e831a2786847de08bac0d8751e991c816a
author
brice · · 2026-07-17 09:22 UTC
parent
7995fb3
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +8 -2
M internal/usecase/client/client_test.go +8 -2
@@ -1121,7 +1121,10 @@ func TestAttachSchemeRequeryCreatesPaletteGenerationBoundary(t *testing.T) {
11211121 tr.EXPECT().Send(isType(ports.MsgHello)).Return(nil).Once()
11221122 tr.EXPECT().Send(isType(ports.MsgTheme)).RunAndReturn(func(f ports.Frame) error {
11231123 theme, err := ports.UnmarshalTheme(f.Payload)
1124- require.NoError(t, err)
1124+ if err != nil {
1125+ t.Errorf("decode sent theme: %v", err)
1126+ return err
1127+ }
11251128 themes <- theme
11261129 return nil
11271130 }).Times(3)
@@ -1210,7 +1213,10 @@ func TestAttachSchemeRequeryClearsStalePalette(t *testing.T) {
12101213 tr.EXPECT().Send(isType(ports.MsgHello)).Return(nil).Once()
12111214 tr.EXPECT().Send(isType(ports.MsgTheme)).RunAndReturn(func(f ports.Frame) error {
12121215 theme, err := ports.UnmarshalTheme(f.Payload)
1213- require.NoError(t, err)
1216+ if err != nil {
1217+ t.Errorf("decode sent theme: %v", err)
1218+ return err
1219+ }
12141220 themesMu.Lock()
12151221 themes = append(themes, theme)
12161222 themesMu.Unlock()
@@ -1121,7 +1121,10 @@ func TestAttachSchemeRequeryCreatesPaletteGenerationBoundary(t *testing.T) {
1121 tr.EXPECT().Send(isType(ports.MsgHello)).Return(nil).Once()1121 tr.EXPECT().Send(isType(ports.MsgHello)).Return(nil).Once()
1122 tr.EXPECT().Send(isType(ports.MsgTheme)).RunAndReturn(func(f ports.Frame) error {1122 tr.EXPECT().Send(isType(ports.MsgTheme)).RunAndReturn(func(f ports.Frame) error {
1123 theme, err := ports.UnmarshalTheme(f.Payload)1123 theme, err := ports.UnmarshalTheme(f.Payload)
1124- require.NoError(t, err)1124+ if err != nil {
1125+ t.Errorf("decode sent theme: %v", err)
1126+ return err
1127+ }
1125 themes <- theme1128 themes <- theme
1126 return nil1129 return nil
1127 }).Times(3)1130 }).Times(3)
@@ -1210,7 +1213,10 @@ func TestAttachSchemeRequeryClearsStalePalette(t *testing.T) {
1210 tr.EXPECT().Send(isType(ports.MsgHello)).Return(nil).Once()1213 tr.EXPECT().Send(isType(ports.MsgHello)).Return(nil).Once()
1211 tr.EXPECT().Send(isType(ports.MsgTheme)).RunAndReturn(func(f ports.Frame) error {1214 tr.EXPECT().Send(isType(ports.MsgTheme)).RunAndReturn(func(f ports.Frame) error {
1212 theme, err := ports.UnmarshalTheme(f.Payload)1215 theme, err := ports.UnmarshalTheme(f.Payload)
1213- require.NoError(t, err)1216+ if err != nil {
1217+ t.Errorf("decode sent theme: %v", err)
1218+ return err
1219+ }
1214 themesMu.Lock()1220 themesMu.Lock()
1215 themes = append(themes, theme)1221 themes = append(themes, theme)
1216 themesMu.Unlock()1222 themesMu.Unlock()

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