(t *testing.T)
| 193 | } |
| 194 | |
| 195 | func 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 | |
| 214 | func TestJournalReadReturns204FallsBackToLegacyHTML(t *testing.T) { |
| 215 | server := journalServerWithReadBehavior(t, "204-with-fallback") |
nothing calls this directly
no test coverage detected