Trust embedded Zillow photo sets without visible count
This commit is contained in:
@@ -84,5 +84,38 @@ test("shouldUseStructuredZillowPhotos returns false when structured photos are i
|
||||
url: `https://photos.zillowstatic.com/fp/photo-${index + 1}-p_d.jpg`,
|
||||
}));
|
||||
|
||||
assert.equal(shouldUseStructuredZillowPhotos(candidates, 29), false);
|
||||
assert.equal(shouldUseStructuredZillowPhotos(candidates, { expectedPhotoCount: 29 }), false);
|
||||
});
|
||||
|
||||
test("shouldUseStructuredZillowPhotos returns true when meta-description count matches even without visible page count", () => {
|
||||
const candidates = Array.from({ length: 29 }, (_, index) => ({
|
||||
url: `https://photos.zillowstatic.com/fp/photo-${index + 1}-p_d.jpg`,
|
||||
}));
|
||||
|
||||
assert.equal(
|
||||
shouldUseStructuredZillowPhotos(candidates, { expectedPhotoCount: null, fallbackPhotoCount: 29 }),
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
test("shouldUseStructuredZillowPhotos returns true for a substantial structured set when no count signal is available", () => {
|
||||
const candidates = Array.from({ length: 18 }, (_, index) => ({
|
||||
url: `https://photos.zillowstatic.com/fp/photo-${index + 1}-p_d.jpg`,
|
||||
}));
|
||||
|
||||
assert.equal(
|
||||
shouldUseStructuredZillowPhotos(candidates, { expectedPhotoCount: null, fallbackPhotoCount: null }),
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
test("shouldUseStructuredZillowPhotos returns false for a tiny structured set when no count signal is available", () => {
|
||||
const candidates = Array.from({ length: 5 }, (_, index) => ({
|
||||
url: `https://photos.zillowstatic.com/fp/photo-${index + 1}-p_d.jpg`,
|
||||
}));
|
||||
|
||||
assert.equal(
|
||||
shouldUseStructuredZillowPhotos(candidates, { expectedPhotoCount: null, fallbackPhotoCount: null }),
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user