mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
fix brokn unit tests
This commit is contained in:
parent
86642de2a2
commit
8e9e093def
1 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue