MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestJournalReadReturns200WithContent

Function TestJournalReadReturns200WithContent

internal/cmd/journal_test.go:195–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

193}
194
195func TestJournalReadReturns200WithContent(t *testing.T) {
196 server := journalServerWithReadBehavior(t, "200")
197 defer server.Close()
198
199 resp, err := runJournalRead(t, server, "2024-01-15")
200 if err != nil {
201 t.Fatalf("execute: %v", err)
202 }
203
204 data, ok := resp.Data.(map[string]any)
205 if !ok {
206 t.Fatalf("data type = %T, want map[string]any", resp.Data)
207 }
208 content, _ := data["content"].(string)
209 if !strings.Contains(content, "Entry for 2024-01-15") {
210 t.Errorf("content = %q, want to contain %q", content, "Entry for 2024-01-15")
211 }
212}
213
214func TestJournalReadReturns204FallsBackToLegacyHTML(t *testing.T) {
215 server := journalServerWithReadBehavior(t, "204-with-fallback")

Callers

nothing calls this directly

Calls 2

runJournalReadFunction · 0.85

Tested by

no test coverage detected