Use Zillow parcel hints for CAD lookup
This commit is contained in:
@@ -291,3 +291,90 @@ test("resolvePublicRecords enriches official CAD property facts when a supported
|
||||
fetchedUrls.some((url) => url.includes("esearch.nuecescad.net/property/view/14069438"))
|
||||
);
|
||||
});
|
||||
|
||||
test("resolvePublicRecords uses formatted Nueces Geographic ID search when a parcel ID is available", async () => {
|
||||
const fetchedUrls: string[] = [];
|
||||
const enrichedFetchText = async (url: string): Promise<string> => {
|
||||
fetchedUrls.push(url);
|
||||
|
||||
if (url.includes("geocoding.geo.census.gov")) {
|
||||
return JSON.stringify(geocoderPayload);
|
||||
}
|
||||
if (url.endsWith("/county-directory/")) {
|
||||
return countyIndexHtml;
|
||||
}
|
||||
if (url.endsWith("/county-directory/nueces.php")) {
|
||||
return countyPageHtml.replace(
|
||||
"http://www.ncadistrict.com/",
|
||||
"https://nuecescad.net/"
|
||||
);
|
||||
}
|
||||
if (url === "https://nuecescad.net/") {
|
||||
return `
|
||||
<html>
|
||||
<body>
|
||||
<a href="https://esearch.nuecescad.net/">Property Search</a>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
}
|
||||
if (url === "https://esearch.nuecescad.net/") {
|
||||
return `
|
||||
<html>
|
||||
<head>
|
||||
<meta name="search-token" content="token-value|2026-03-28T00:00:00Z" />
|
||||
</head>
|
||||
<body>
|
||||
Property Search
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
}
|
||||
if (url.includes("/search/SearchResults?")) {
|
||||
assert.match(url, /keywords=1234-5678-9012/);
|
||||
return JSON.stringify({
|
||||
success: true,
|
||||
resultsList: [
|
||||
{
|
||||
propertyId: "200016970",
|
||||
ownerName: "NGUYEN TRANG THUY",
|
||||
ownerId: "677681",
|
||||
address: "6702 Everhart Rd Apt T106, Corpus Christi, TX 78413",
|
||||
legalDescription: "UNIT T106 EXAMPLE CONDO",
|
||||
appraisedValueDisplay: "$128,876",
|
||||
detailUrl: "/property/view/200016970?year=2026"
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
if (url === "https://esearch.nuecescad.net/property/view/200016970?year=2026") {
|
||||
return `
|
||||
<html>
|
||||
<body>
|
||||
<div class="property-summary">
|
||||
<div>Owner Name</div><div>NGUYEN TRANG THUY</div>
|
||||
<div>Account Number</div><div>200016970</div>
|
||||
<div>Situs Address</div><div>6702 Everhart Rd Apt T106, Corpus Christi, TX 78413</div>
|
||||
<div>Legal Description</div><div>UNIT T106 EXAMPLE CONDO</div>
|
||||
<div>Land Value</div><div>$20,000</div>
|
||||
<div>Improvement Value</div><div>$108,876</div>
|
||||
<div>Market Value</div><div>$128,876</div>
|
||||
<div>Assessed Value</div><div>$128,876</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
}
|
||||
throw new Error(`Unexpected URL: ${url}`);
|
||||
};
|
||||
|
||||
const payload = await resolvePublicRecords("6702 Everhart Rd APT T106, Corpus Christi, TX 78413", {
|
||||
parcelId: "123456789012",
|
||||
fetchText: enrichedFetchText
|
||||
});
|
||||
|
||||
assert.equal(payload.propertyDetails?.propertyId, "200016970");
|
||||
assert.ok(
|
||||
fetchedUrls.some((url) => url.includes("keywords=1234-5678-9012"))
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user