Initial curated projectbrain source from 8a7b1e0651dbdab97d744cbd2e653ab3970ac6c5
This commit is contained in:
commit
5aa3e8d685
700 files changed
+132801
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { ReviewStatus } from "@prisma/client";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { reviewRequiresHumanAttention } from "../src/repositories/reviewAttentionPolicy.js";
|
||||
|
||||
const review = (overrides: Partial<{ status: ReviewStatus; source: string; sourceType: string; createdBy: string }> = {}) => ({
|
||||
status: ReviewStatus.pending,
|
||||
source: "projectbrain_runtime",
|
||||
sourceType: "documentation_update",
|
||||
createdBy: "api",
|
||||
...overrides,
|
||||
});
|
||||
|
||||
describe("review attention policy", () => {
|
||||
it("keeps genuine unresolved reviews visible", () => {
|
||||
expect(reviewRequiresHumanAttention(review())).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps seed and smoke evidence out of the owner's attention count", () => {
|
||||
expect(reviewRequiresHumanAttention(review({ createdBy: "seed" }))).toBe(false);
|
||||
expect(reviewRequiresHumanAttention(review({ source: "rc41-smoke-proof" }))).toBe(false);
|
||||
expect(reviewRequiresHumanAttention(review({ sourceType: "SMOKE_IMPORT" }))).toBe(false);
|
||||
});
|
||||
|
||||
it("requires an unresolved status", () => {
|
||||
expect(reviewRequiresHumanAttention(review({ status: ReviewStatus.accepted }))).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user