Rename Factory to Foundry

This commit is contained in:
Nathan Flurry 2026-03-10 22:01:39 -07:00
parent 0a8fda040b
commit 324de36577
256 changed files with 605 additions and 603 deletions

View file

@ -0,0 +1,21 @@
import { describe, expect, it } from "vitest";
import { resolveEventListOffset } from "../src/actors/sandbox-instance/persist.js";
describe("sandbox-instance persist event offset", () => {
it("returns newest tail when cursor is omitted", () => {
expect(resolveEventListOffset({ total: 180, limit: 50 })).toBe(130);
});
it("returns zero when total rows are below page size", () => {
expect(resolveEventListOffset({ total: 20, limit: 50 })).toBe(0);
});
it("uses explicit cursor when provided", () => {
expect(resolveEventListOffset({ cursor: "7", total: 180, limit: 50 })).toBe(7);
});
it("normalizes invalid cursors to zero", () => {
expect(resolveEventListOffset({ cursor: "-3", total: 180, limit: 50 })).toBe(0);
expect(resolveEventListOffset({ cursor: "not-a-number", total: 180, limit: 50 })).toBe(0);
});
});