AkurAI Build
Menu

popagent

public

Latest change 770b3f9e71398c87310eddcf6c2cec0f603cd0e7 - Add repository changelog page by AkurAI Build

import { describe, expect, test } from "bun:test";
import { renderToStaticMarkup } from "react-dom/server";
import { ChangelogTimeline, parseChangelog } from "./ChangelogPage";

const markdown = `# Changelog\n\n## [Unreleased]\n\n### Added\n\n- Shipped the timeline.\n- Kept the force-push button untouched.\n\n## [1.0.0] - 2026-08-15\n\n### Fixed\n\n- Fixed a tiny gremlin.\n`;

describe("changelog presentation", () => {
  test("parses releases, categories, and bullet entries", () => {
    expect(parseChangelog(markdown)).toEqual([
      { title: "Unreleased", date: undefined, groups: [{ title: "Added", items: ["Shipped the timeline.", "Kept the force-push button untouched."] }] },
      { title: "1.0.0", date: "2026-08-15", groups: [{ title: "Fixed", items: ["Fixed a tiny gremlin."] }] },
    ]);
  });

  test("renders a repository timeline with release semantics", () => {
    const html = renderToStaticMarkup(<ChangelogTimeline markdown={markdown} />);
    expect(html).toContain("Release feed");
    expect(html).toContain("Unreleased");
    expect(html).toContain("1.0.0");
    expect(html).toContain("Fixed a tiny gremlin.");
  });
});