mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-27 22:45:03 +00:00
Exclude Retrofit Design Documents from the install-document bucket 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
259c36e652
commit
00a9f22925
1 changed files with 32 additions and 0 deletions
|
|
@ -94,6 +94,25 @@ describe("deriveDesignDocDealIds", () => {
|
|||
// Assert
|
||||
expect(designDocDealIds.has("deal-1")).toBe(true);
|
||||
});
|
||||
|
||||
it("excludes a deal whose documents contain no Retrofit Design Document", () => {
|
||||
// Arrange — only survey/install docs, no design document
|
||||
const docsByDealId = new Map([
|
||||
[
|
||||
"deal-1",
|
||||
[
|
||||
{ fileType: "photo_pack", measureName: null },
|
||||
{ fileType: "pre_photo", measureName: "CWI" },
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
// Act
|
||||
const designDocDealIds = deriveDesignDocDealIds(docsByDealId);
|
||||
|
||||
// Assert
|
||||
expect(designDocDealIds.has("deal-1")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("computeDocStatusMap", () => {
|
||||
|
|
@ -138,6 +157,19 @@ describe("computeDocStatusMap", () => {
|
|||
expect(measureNames).not.toContain("CWI");
|
||||
});
|
||||
|
||||
it("does not report install documents for a deal holding only a Retrofit Design Document", () => {
|
||||
// Arrange — a design document is not an install document
|
||||
const deal = makeDeal({ dealId: "deal-1", proposedMeasures: "CWI" });
|
||||
const docs = new Map([["deal-1", [{ fileType: "retrofit_design_doc", measureName: null }]]]);
|
||||
|
||||
// Act
|
||||
const result = computeDocStatusMap([deal], docs, {});
|
||||
|
||||
// Assert
|
||||
expect(result["deal-1"].hasInstallDocs).toBe(false);
|
||||
expect(result["deal-1"].installStatus).toBe("none");
|
||||
});
|
||||
|
||||
describe("installStatus", () => {
|
||||
// CWI requires only BASE_DOCS — simple to satisfy in tests
|
||||
const cwi = "CWI";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue