Strip pin metadata from web conversations

This commit is contained in:
kris
2026-04-11 03:05:37 +08:00
parent 5bf745f45f
commit e0c0ea1814
4 changed files with 100 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
import test from "node:test";
import assert from "node:assert/strict";
import path from "node:path";
import { readFile } from "node:fs/promises";
import { fileURLToPath } from "node:url";
const testsDir = path.dirname(fileURLToPath(import.meta.url));
async function readWorkspaceFile(relativePath: string) {
return readFile(path.join(testsDir, "..", relativePath), "utf8");
}
test("web conversations page uses a web-specific projection without pin metadata", async () => {
const [pageSource, projectionsSource] = await Promise.all([
readWorkspaceFile("src/app/conversations/page.tsx"),
readWorkspaceFile("src/lib/boss-projections.ts"),
]);
assert.match(
projectionsSource,
/export function getConversationWebItems\(/,
"expected a web-specific conversation projection helper",
);
assert.match(
pageSource,
/const conversations = getConversationWebItems\(state\);/,
"expected the web conversations page to use the web-specific projection",
);
});