Block preliminary property assessor PDFs
This commit is contained in:
@@ -198,8 +198,9 @@ test("assessProperty falls back to HAR when Zillow photo extraction fails", asyn
|
||||
);
|
||||
});
|
||||
|
||||
test("assessProperty renders a PDF when recipient email is present", async () => {
|
||||
test("assessProperty does not render a PDF from a preliminary helper payload even when recipient email is present", async () => {
|
||||
const outputPath = path.join(os.tmpdir(), `property-assess-command-${Date.now()}.pdf`);
|
||||
let renderCalls = 0;
|
||||
const result = await assessProperty(
|
||||
{
|
||||
address: "4141 Whiteley Dr, Corpus Christi, TX 78418",
|
||||
@@ -213,16 +214,21 @@ test("assessProperty renders a PDF when recipient email is present", async () =>
|
||||
attempts: ["No listing sources discovered from the address."],
|
||||
zillowUrl: null,
|
||||
harUrl: null
|
||||
})
|
||||
}),
|
||||
renderReportPdfFn: async () => {
|
||||
renderCalls += 1;
|
||||
return outputPath;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
assert.equal(result.ok, true);
|
||||
assert.equal(result.needsAssessmentPurpose, false);
|
||||
assert.equal(result.needsRecipientEmails, false);
|
||||
assert.equal(result.outputPath, outputPath);
|
||||
const stat = await fs.promises.stat(outputPath);
|
||||
assert.ok(stat.size > 1000);
|
||||
assert.equal(renderCalls, 0);
|
||||
assert.equal(result.pdfReady, false);
|
||||
assert.equal(result.outputPath, null);
|
||||
assert.match(result.message, /preliminary|decision-grade|cannot render/i);
|
||||
});
|
||||
|
||||
test("assessProperty prioritizes student housing guidance over investment fallback keywords", async () => {
|
||||
|
||||
Reference in New Issue
Block a user