23 lines
692 B
TypeScript
23 lines
692 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import { factSessionSummary } from "./server-workbench-facts.ts";
|
|
|
|
test("session summary preserves createdAt without using updatedAt as fallback", () => {
|
|
const createdAt = "2026-07-23T07:30:00.000Z";
|
|
const summary = factSessionSummary({
|
|
sessionId: "ses_created_at",
|
|
status: "idle",
|
|
createdAt,
|
|
updatedAt: "2026-07-23T08:30:00.000Z",
|
|
});
|
|
assert.equal(summary?.createdAt, createdAt);
|
|
|
|
const withoutCreatedAt = factSessionSummary({
|
|
sessionId: "ses_without_created_at",
|
|
status: "idle",
|
|
updatedAt: "2026-07-23T08:30:00.000Z",
|
|
});
|
|
assert.equal(withoutCreatedAt?.createdAt, null);
|
|
});
|