The saved row was the whole dossier twice. Keep the default and Raman match results, drop a concurrent duplicate insert back to the first row, and hide the new rows from the old history list. Checked service tests 9/9, tsc 0, lint 0 errors, and test:db 73 pass / 13 fail matching the Windows known list. Co-Authored-By: Grok (agent loop) Co-authored-by: Cursor <cursoragent@cursor.com>
11 lines
553 B
TypeScript
11 lines
553 B
TypeScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import test from "node:test";
|
|
|
|
test("old synastry history lists only rows that have no rules version", () => {
|
|
const source = readFileSync(new URL("../src/app/api/synastry-reports/route.ts", import.meta.url), "utf8");
|
|
const get = source.slice(source.indexOf("export async function GET"), source.indexOf("export async function POST"));
|
|
assert.match(get, /\.select\("id, partner_name, report, created_at"\)/);
|
|
assert.match(get, /\.is\("rules_version", null\)/);
|
|
});
|