fix: require completed photo review before pdf render
This commit is contained in:
@@ -87,3 +87,23 @@ test("renderReportPdf rejects a preliminary report with pending verdict", async
|
||||
/decision-grade|preliminary|pending/i
|
||||
);
|
||||
});
|
||||
|
||||
test("renderReportPdf rejects a report when subject-unit photo review is not completed", async () => {
|
||||
const outputPath = path.join(os.tmpdir(), `property-assessor-missing-photos-${Date.now()}.pdf`);
|
||||
await assert.rejects(
|
||||
() =>
|
||||
renderReportPdf(
|
||||
{
|
||||
...samplePayload,
|
||||
photoReview: {
|
||||
status: "not completed",
|
||||
source: "accessible listing-photo source not reliably exposed for unit 235",
|
||||
attempts: ["Zillow and HAR photo review did not complete."],
|
||||
summary: "Condition review is incomplete."
|
||||
}
|
||||
},
|
||||
outputPath
|
||||
),
|
||||
/photo review|decision-grade|incomplete/i
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user