Test that the operator's Approve says accepted, by whom and on which warrant (issue 595, W15.1)

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ

(Joined from 65c6ca40.)
Builds: design 47 G §319, test 59 (KB1)

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 14:48:07 +01:00
parent 6f7d070769
commit 6d4ad2c249
@@ -2,6 +2,7 @@ package main
import (
"context"
"fmt"
"strings"
"testing"
"time"
@@ -283,6 +284,12 @@ func TestARecordThatNeedsTheOperatorIsAcceptedOnlyOnTheWarrant(t *testing.T) {
if last := vs[len(vs)-1]; !strings.Contains(last.Why, "warrant") || last.By != "the operator" {
t.Fatalf("the accepting version: %+v", last)
}
// Issue 595: a session waiting on the Approve wakes on this event (node-tools' `waits` names it); it says who
// accepted and on which warrant.
if got := w.said.of(EventAccepted); len(got) != 1 || got[0]["by"] != "the operator" || got[0]["record"] != itoaKey(n) ||
!strings.Contains(fmt.Sprint(got[0]["what"]), "warrant") {
t.Fatalf("the accepted event: %v", got)
}
if said, _ := w.k.Reconcile(); len(said) != 0 {
t.Fatalf("decided twice: %v", said)
}