AkurAI Build
Menu

popagent

public

Latest change 1d29dff4c5c63378a8860a94989afec219abff9c - Show live Memory system graph by Ólafur Búi Ólafsson

import { describe, expect, test } from "bun:test";
import { renderToStaticMarkup } from "react-dom/server";
import { MemorySystemGraph } from "./MemorySettingsPanel";

describe("MemorySystemGraph", () => {
  test("shows live memory stores, status, and execution paths", () => {
    const html = renderToStaticMarkup(<MemorySystemGraph settings={{
      autoCompact: true,
      observationTokens: 30_000,
      reflectionTokens: 40_000,
      retrievalEnabled: true,
      retrievalScope: "resource",
      internalRecall: true,
      internalRetention: true,
    }} status={{ facts: 12, episodes: 34, recalled: 9, latestUpdatedAt: "2026-08-14T12:00:00.000Z" }} />);

    expect(html).toContain('aria-label="Memory system graph"');
    expect(html).toContain("PostgreSQL · popagent_memories");
    expect(html).toContain("12 facts");
    expect(html).toContain("34 episodes");
    expect(html).toContain("9 recalled");
    expect(html).toContain("Mastra thread state");
    expect(html).toContain("Internal recall on");
  });
});