Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(e2e): link-source repair test restores the canonical links_link_source_check for later files

garrytan938e3dc32c11
diff --git a/test/e2e/link-source-check-repair-postgres.test.ts b/test/e2e/link-source-check-repair-postgres.test.ts
index 1015f51aeb..f3957a601f 100644
--- a/test/e2e/link-source-check-repair-postgres.test.ts
+++ b/test/e2e/link-source-check-repair-postgres.test.ts
@@ -54,6 +54,11 @@ beforeAll(async () => {
afterAll(async () => {
if (skip) return;
+ // Leave the canonical constraint for later files on the same database; the last case installs a 'BAD_TAG' variant.
+ await engine.executeRaw(`DELETE FROM links WHERE link_source = 'BAD_TAG'`);
+ await dropConstraint();
+ expect((await repairLinkSourceCheck(engine)).reason).toBe('restored');
+ expect((await checkLinkSourceCheck(engine)).drift).toBeNull();
await teardownDB();
});