detached 114345b

test(daemon): table-drive move picker capability cases

Signed-off-by: brice <b@bnema.dev>
commit
114345bc8571b7fa2f7bbc0172233455a1d16934
author
brice · · 2026-07-29 20:17 UTC
parent
d75f483
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +15 -6
M internal/usecase/daemon/session_capabilities_test.go +15 -6
@@ -37,12 +37,21 @@ func TestSnapshotViewCarriesCannotAcceptMoves(t *testing.T) {
3737 func TestEnterPickerForIntentRejectsNonYieldingSource(t *testing.T) {
3838 d, sess, ac, _ := newManualSessionWithPTYs(t)
3939 sess.caps = sessionCapabilities{cannotYieldMoves: true}
40- err := d.enterPickerForIntent(sess, ac, pickerMoveTab, moveSourceLocator{})
41- if !errors.Is(err, errSessionCannotYieldMoves) {
42- t.Fatalf("enterPickerForIntent error = %v, want errSessionCannotYieldMoves", err)
40+
41+ tests := []struct {
42+ name string
43+ intent pickerIntent
44+ wantErr error
45+ }{
46+ {name: "pickerMoveTab", intent: pickerMoveTab, wantErr: errSessionCannotYieldMoves},
47+ {name: "pickerNavigate", intent: pickerNavigate, wantErr: nil},
4348 }
44- // Navigation intent must stay unaffected by the yield capability.
45- if err := d.enterPickerForIntent(sess, ac, pickerNavigate, moveSourceLocator{}); err != nil {
46- t.Fatalf("navigate intent returned %v, want nil", err)
49+ for _, tt := range tests {
50+ t.Run(tt.name, func(t *testing.T) {
51+ err := d.enterPickerForIntent(sess, ac, tt.intent, moveSourceLocator{})
52+ if !errors.Is(err, tt.wantErr) {
53+ t.Fatalf("enterPickerForIntent error = %v, want %v", err, tt.wantErr)
54+ }
55+ })
4756 }
4857 }
@@ -37,12 +37,21 @@ func TestSnapshotViewCarriesCannotAcceptMoves(t *testing.T) {
37 func TestEnterPickerForIntentRejectsNonYieldingSource(t *testing.T) {37 func TestEnterPickerForIntentRejectsNonYieldingSource(t *testing.T) {
38 d, sess, ac, _ := newManualSessionWithPTYs(t)38 d, sess, ac, _ := newManualSessionWithPTYs(t)
39 sess.caps = sessionCapabilities{cannotYieldMoves: true}39 sess.caps = sessionCapabilities{cannotYieldMoves: true}
40- err := d.enterPickerForIntent(sess, ac, pickerMoveTab, moveSourceLocator{})40+
41- if !errors.Is(err, errSessionCannotYieldMoves) {41+ tests := []struct {
42- t.Fatalf("enterPickerForIntent error = %v, want errSessionCannotYieldMoves", err)42+ name string
43+ intent pickerIntent
44+ wantErr error
45+ }{
46+ {name: "pickerMoveTab", intent: pickerMoveTab, wantErr: errSessionCannotYieldMoves},
47+ {name: "pickerNavigate", intent: pickerNavigate, wantErr: nil},
43 }48 }
44- // Navigation intent must stay unaffected by the yield capability.49+ for _, tt := range tests {
45- if err := d.enterPickerForIntent(sess, ac, pickerNavigate, moveSourceLocator{}); err != nil {50+ t.Run(tt.name, func(t *testing.T) {
46- t.Fatalf("navigate intent returned %v, want nil", err)51+ err := d.enterPickerForIntent(sess, ac, tt.intent, moveSourceLocator{})
52+ if !errors.Is(err, tt.wantErr) {
53+ t.Fatalf("enterPickerForIntent error = %v, want %v", err, tt.wantErr)
54+ }
55+ })
47 }56 }
48 }57 }

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