// One-line event summaries. The UI renders a kind it does not know // generically, so a newer server's events still show (the journal appends // new kinds: internal/journal/kind_wire_test.go), and no detail, however // malformed, breaks the page. import { describe, expect, test } from "bun:test"; import type { JournalEvent } from "../src/journal"; import { journalKinds } from "../src/labels.gen"; import { summary } from "../src/summary"; import { event, forAll, int, pick, type Rng } from "./gen"; /** A random JSON value, nested up to depth. */ function value(r: Rng, depth: number): unknown { switch (int(r, depth > 0 ? 7 : 5)) { case 0: return null; case 1: return int(r, 2) === 0; case 2: return pick(r, [0, -1, 1.5, 1e21, 42]); case 3: return pick(r, ["", "x", "é€😀", "