From 86642de2a21583c8e1d79143d996bbf35740cc69 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 15 Jun 2026 13:06:28 +0000 Subject: [PATCH 1/3] Don't include PAR photopack in MIssing Documents list --- .../portfolio/[slug]/(portfolio)/your-projects/live/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/portfolio/[slug]/(portfolio)/your-projects/live/types.ts b/src/app/portfolio/[slug]/(portfolio)/your-projects/live/types.ts index 6f2ab002..aa49fe25 100644 --- a/src/app/portfolio/[slug]/(portfolio)/your-projects/live/types.ts +++ b/src/app/portfolio/[slug]/(portfolio)/your-projects/live/types.ts @@ -238,7 +238,6 @@ export const EXPECTED_RETROFIT_ASSESSMENT_DOC_TYPES = [ "rd_sap_site_note", "pas_2023_ventilation", "pas_2023_condition", - "par_photo_pack", "pas_2023_property", "pas_2023_occupancy", ] as const; @@ -250,6 +249,7 @@ export const SURVEY_ALL_DOC_TYPES = new Set([ "ecmk_rd_sap_site_note", "ecmk_survey_xml", "pas_significance", + "par_photo_pack", ]); // Coordination doc types From 8e9e093defe27ba44c7130a7727007ccf2b3fc3a Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 15 Jun 2026 13:38:01 +0000 Subject: [PATCH 2/3] fix brokn unit tests --- .../your-projects/live/propertyDocuments.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/portfolio/[slug]/(portfolio)/your-projects/live/propertyDocuments.test.ts b/src/app/portfolio/[slug]/(portfolio)/your-projects/live/propertyDocuments.test.ts index 76ba0136..225ff996 100644 --- a/src/app/portfolio/[slug]/(portfolio)/your-projects/live/propertyDocuments.test.ts +++ b/src/app/portfolio/[slug]/(portfolio)/your-projects/live/propertyDocuments.test.ts @@ -75,20 +75,20 @@ describe("splitDocumentsByType", () => { describe("getMissingRetrofitTypes", () => { it("returns all mandatory types when no docs uploaded", () => { const missing = getMissingSurveyDocTypes([]); - expect(missing).toHaveLength(8); + expect(missing).toHaveLength(7); }); it("excludes types that have been uploaded", () => { const uploaded = [makeDoc({ docType: "photo_pack" })]; const missing = getMissingSurveyDocTypes(uploaded); expect(missing).not.toContain("photo_pack"); - expect(missing).toHaveLength(7); + expect(missing).toHaveLength(6); }); it("returns empty array when all mandatory types uploaded", () => { const uploaded = [ "photo_pack", "site_note", "rd_sap_site_note", "pas_2023_ventilation", - "pas_2023_condition", "pas_significance", "par_photo_pack", + "pas_2023_condition", "pas_significance", "pas_2023_property", "pas_2023_occupancy", ].map((docType, i) => makeDoc({ id: String(i), docType })); expect(getMissingSurveyDocTypes(uploaded)).toHaveLength(0); @@ -98,7 +98,7 @@ describe("getMissingRetrofitTypes", () => { const uploaded = [makeDoc({ docType: "ecmk_site_note" })]; const missing = getMissingSurveyDocTypes(uploaded); expect(missing).not.toContain("ecmk_site_note"); - expect(missing).toHaveLength(8); + expect(missing).toHaveLength(7); }); }); From e3ee1480aae5f20dd75b740560bca385e9880caf Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 15 Jun 2026 13:42:03 +0000 Subject: [PATCH 3/3] dont hardcode expected file count in tests --- .../your-projects/live/propertyDocuments.test.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/app/portfolio/[slug]/(portfolio)/your-projects/live/propertyDocuments.test.ts b/src/app/portfolio/[slug]/(portfolio)/your-projects/live/propertyDocuments.test.ts index 225ff996..55e71447 100644 --- a/src/app/portfolio/[slug]/(portfolio)/your-projects/live/propertyDocuments.test.ts +++ b/src/app/portfolio/[slug]/(portfolio)/your-projects/live/propertyDocuments.test.ts @@ -5,6 +5,7 @@ import { getUnassignedInstallDocs, } from "./propertyDocuments"; import type { PropertyDocument, MeasureDocProgress } from "./types"; +import { EXPECTED_RETROFIT_ASSESSMENT_DOC_TYPES } from "./types"; function makeDoc(overrides: Partial = {}): PropertyDocument { return { @@ -75,22 +76,20 @@ describe("splitDocumentsByType", () => { describe("getMissingRetrofitTypes", () => { it("returns all mandatory types when no docs uploaded", () => { const missing = getMissingSurveyDocTypes([]); - expect(missing).toHaveLength(7); + expect(missing).toHaveLength(EXPECTED_RETROFIT_ASSESSMENT_DOC_TYPES.length); }); it("excludes types that have been uploaded", () => { const uploaded = [makeDoc({ docType: "photo_pack" })]; const missing = getMissingSurveyDocTypes(uploaded); expect(missing).not.toContain("photo_pack"); - expect(missing).toHaveLength(6); + expect(missing).toHaveLength(EXPECTED_RETROFIT_ASSESSMENT_DOC_TYPES.length - 1); }); it("returns empty array when all mandatory types uploaded", () => { - const uploaded = [ - "photo_pack", "site_note", "rd_sap_site_note", "pas_2023_ventilation", - "pas_2023_condition", "pas_significance", - "pas_2023_property", "pas_2023_occupancy", - ].map((docType, i) => makeDoc({ id: String(i), docType })); + const uploaded = EXPECTED_RETROFIT_ASSESSMENT_DOC_TYPES.map((docType, i) => + makeDoc({ id: String(i), docType }) + ); expect(getMissingSurveyDocTypes(uploaded)).toHaveLength(0); }); @@ -98,7 +97,7 @@ describe("getMissingRetrofitTypes", () => { const uploaded = [makeDoc({ docType: "ecmk_site_note" })]; const missing = getMissingSurveyDocTypes(uploaded); expect(missing).not.toContain("ecmk_site_note"); - expect(missing).toHaveLength(7); + expect(missing).toHaveLength(EXPECTED_RETROFIT_ASSESSMENT_DOC_TYPES.length); }); });