MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestRender

Function TestRender

internal/harness/claude/transcript_test.go:37–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestRender(t *testing.T) {
38 out := renderToString(t, sampleSessionJSONL, false)
39
40 checks := []struct {
41 label string
42 contains string
43 }{
44 {"user message", "─── User ───"},
45 {"user text", "Hello, can you help me?"},
46 {"thinking", "─── Thinking ───"},
47 {"thinking text", "The user wants help."},
48 {"assistant text", "Sure, let me check."},
49 {"tool use bash", "─── Tool: Bash ───"},
50 {"bash command", "$ echo hello"},
51 {"tool result", "─── Result ───"},
52 {"result content", "hello"},
53 {"tool use read", "─── Tool: Read ───"},
54 {"read path", "/tmp/test.go"},
55 {"read offset", "offset=10"},
56 {"read limit", "limit=20"},
57 {"final text", "Done!"},
58 }
59 for _, c := range checks {
60 if !strings.Contains(out, c.contains) {
61 t.Errorf("%s: output missing %q", c.label, c.contains)
62 }
63 }
64
65 // Skipped types don't leak.
66 if strings.Contains(out, "permission-mode") {
67 t.Error("permission-mode record leaked into output")
68 }
69 if strings.Contains(out, "file-history-snapshot") {
70 t.Error("file-history-snapshot record leaked into output")
71 }
72}
73
74func TestRenderCompact(t *testing.T) {
75 out := renderToString(t, sampleSessionJSONL, true)

Callers

nothing calls this directly

Calls 2

renderToStringFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected