diff --git a/modules/mesh-issues/cmd/mesh-issues/tracking_test.go b/modules/mesh-issues/cmd/mesh-issues/tracking_test.go index e34d7e87..10c9a21c 100644 --- a/modules/mesh-issues/cmd/mesh-issues/tracking_test.go +++ b/modules/mesh-issues/cmd/mesh-issues/tracking_test.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "reflect" "strings" "testing" "time" @@ -137,10 +138,15 @@ func TestTheTrackingVerb(t *testing.T) { if _, err := h.Note(n, "the share's password=hunter2 was typed here"); err != nil { t.Fatal(err) } + events, before := len(h.said()), h.mem.snapshot(IssuesState) out, err := h.call(t, "tracking", map[string]any{}) if err != nil { t.Fatal(err) } + // A read: no event said, nothing written. + if len(h.said()) != events || !reflect.DeepEqual(h.mem.snapshot(IssuesState), before) { + t.Fatal("tracking said an event or wrote an issue") + } raw, _ := json.Marshal(out) if !strings.Contains(string(raw), `"`+mountsKey+`":[{"number":`) { t.Fatalf("%s", raw)