fix brokn unit tests

This commit is contained in:
Daniel Roth 2026-06-15 13:38:01 +00:00
parent 86642de2a2
commit 8e9e093def

View file

@ -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);
});
});