detached 707278a

test(daemon): assert notification action errors

commit
707278a49fdcb9805f6b445b4d704410c2ae67b4
author
brice · · 2026-07-21 11:04 UTC
parent
89abebd
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +8 -4
M internal/usecase/daemon/attention_test.go +1 -1
@@ -511,7 +511,7 @@ func TestJumpAttentionCrossesSessionsWhenNoLocalBells(t *testing.T) {
511511 }
512512 d.sessions[sess2.id] = sess2
513513
514- d.jumpAttention(sess1, ac)
514+ require.NoError(t, d.jumpAttention(sess1, ac))
515515
516516 require.Same(t, sess2, ac.currentSession())
517517 require.Same(t, ac, sess2.client)
@@ -511,7 +511,7 @@ func TestJumpAttentionCrossesSessionsWhenNoLocalBells(t *testing.T) {
511 }511 }
512 d.sessions[sess2.id] = sess2512 d.sessions[sess2.id] = sess2
513 513
514- d.jumpAttention(sess1, ac)514+ require.NoError(t, d.jumpAttention(sess1, ac))
515 515
516 require.Same(t, sess2, ac.currentSession())516 require.Same(t, sess2, ac.currentSession())
517 require.Same(t, ac, sess2.client)517 require.Same(t, ac, sess2.client)
M internal/usecase/daemon/input_test.go +6 -2
@@ -618,7 +618,7 @@ func TestPaletteBackSessionTogglesPreviousSession(t *testing.T) {
618618 recent := d.sessions[domain.SessionID("recent")]
619619
620620 // Picker-style successful transition records its origin.
621- d.switchToTarget(current, ac, picker.Target{Session: recent.id, TabIndex: -1})
621+ require.NoError(t, d.switchToTarget(current, ac, picker.Target{Session: recent.id, TabIndex: -1}))
622622 for _, sess := range []*session{current, recent, current} {
623623 runPaletteCommand(t, d, ac.currentSession(), ac, "BSK")
624624 require.Same(t, sess, ac.currentSession())
@@ -746,7 +746,11 @@ func TestSwitchSourcePreviousSessionContracts(t *testing.T) {
746746 defer releaseAll(releases)
747747 recent := d.sessions[domain.SessionID("recent")]
748748
749- d.switchToTarget(current, ac, tc.target(current, recent))
749+ if tc.name == "missing target does not record" {
750+ require.Error(t, d.switchToTarget(current, ac, tc.target(current, recent)))
751+ } else {
752+ require.NoError(t, d.switchToTarget(current, ac, tc.target(current, recent)))
753+ }
750754 require.Equal(t, domain.SessionID(tc.wantCurrent), ac.currentSession().id)
751755 if tc.wantPrev == "" {
752756 require.Nil(t, ac.previousSession.Get())
@@ -618,7 +618,7 @@ func TestPaletteBackSessionTogglesPreviousSession(t *testing.T) {
618 recent := d.sessions[domain.SessionID("recent")]618 recent := d.sessions[domain.SessionID("recent")]
619 619
620 // Picker-style successful transition records its origin.620 // Picker-style successful transition records its origin.
621- d.switchToTarget(current, ac, picker.Target{Session: recent.id, TabIndex: -1})621+ require.NoError(t, d.switchToTarget(current, ac, picker.Target{Session: recent.id, TabIndex: -1}))
622 for _, sess := range []*session{current, recent, current} {622 for _, sess := range []*session{current, recent, current} {
623 runPaletteCommand(t, d, ac.currentSession(), ac, "BSK")623 runPaletteCommand(t, d, ac.currentSession(), ac, "BSK")
624 require.Same(t, sess, ac.currentSession())624 require.Same(t, sess, ac.currentSession())
@@ -746,7 +746,11 @@ func TestSwitchSourcePreviousSessionContracts(t *testing.T) {
746 defer releaseAll(releases)746 defer releaseAll(releases)
747 recent := d.sessions[domain.SessionID("recent")]747 recent := d.sessions[domain.SessionID("recent")]
748 748
749- d.switchToTarget(current, ac, tc.target(current, recent))749+ if tc.name == "missing target does not record" {
750+ require.Error(t, d.switchToTarget(current, ac, tc.target(current, recent)))
751+ } else {
752+ require.NoError(t, d.switchToTarget(current, ac, tc.target(current, recent)))
753+ }
750 require.Equal(t, domain.SessionID(tc.wantCurrent), ac.currentSession().id)754 require.Equal(t, domain.SessionID(tc.wantCurrent), ac.currentSession().id)
751 if tc.wantPrev == "" {755 if tc.wantPrev == "" {
752 require.Nil(t, ac.previousSession.Get())756 require.Nil(t, ac.previousSession.Get())
M internal/usecase/daemon/session_test.go +1 -1
@@ -1211,7 +1211,7 @@ func TestPickerStoppedTargetKillPurges(t *testing.T) {
12111211 WithStore(store)(d)
12121212 require.NoError(t, d.persist.Save(persist.Record{Name: "old", Cwd: "/tmp", CreatedAt: 1, UpdatedAt: 1}))
12131213 d.stopped["old"] = stoppedSession{name: "old", cwd: "/tmp", createdAt: 1}
1214- d.killPickerTarget(picker.Target{Name: "old", Stopped: true})
1214+ require.NoError(t, d.killPickerTarget(picker.Target{Name: "old", Stopped: true}))
12151215 require.False(t, state.has("old"))
12161216 d.mu.Lock()
12171217 _, ok := d.stopped["old"]
@@ -1211,7 +1211,7 @@ func TestPickerStoppedTargetKillPurges(t *testing.T) {
1211 WithStore(store)(d)1211 WithStore(store)(d)
1212 require.NoError(t, d.persist.Save(persist.Record{Name: "old", Cwd: "/tmp", CreatedAt: 1, UpdatedAt: 1}))1212 require.NoError(t, d.persist.Save(persist.Record{Name: "old", Cwd: "/tmp", CreatedAt: 1, UpdatedAt: 1}))
1213 d.stopped["old"] = stoppedSession{name: "old", cwd: "/tmp", createdAt: 1}1213 d.stopped["old"] = stoppedSession{name: "old", cwd: "/tmp", createdAt: 1}
1214- d.killPickerTarget(picker.Target{Name: "old", Stopped: true})1214+ require.NoError(t, d.killPickerTarget(picker.Target{Name: "old", Stopped: true}))
1215 require.False(t, state.has("old"))1215 require.False(t, state.has("old"))
1216 d.mu.Lock()1216 d.mu.Lock()
1217 _, ok := d.stopped["old"]1217 _, ok := d.stopped["old"]

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