Use Zillow parcel hints for CAD lookup
This commit is contained in:
@@ -3,6 +3,7 @@ import assert from "node:assert/strict";
|
||||
|
||||
import {
|
||||
extractZillowStructuredPhotoCandidatesFromNextDataScript,
|
||||
extractZillowIdentifierHintsFromNextDataScript,
|
||||
shouldUseStructuredZillowPhotos,
|
||||
} from "./zillow-photo-data.js";
|
||||
|
||||
@@ -119,3 +120,27 @@ test("shouldUseStructuredZillowPhotos returns false for a tiny structured set wh
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
test("extractZillowIdentifierHintsFromNextDataScript finds parcel and APN style identifiers", () => {
|
||||
const scriptText = JSON.stringify({
|
||||
props: {
|
||||
pageProps: {
|
||||
componentProps: {
|
||||
gdpClientCache: JSON.stringify({
|
||||
SomeQuery: {
|
||||
property: {
|
||||
parcelId: "1234567890",
|
||||
apn: "APN-77-55",
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
assert.deepEqual(extractZillowIdentifierHintsFromNextDataScript(scriptText), {
|
||||
parcelId: "1234567890",
|
||||
apn: "APN-77-55",
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user