From c66f8f039b3c26e2cbad8c6d362d4511ce786629 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Tue, 3 Nov 2026 15:04:05 -0800 Subject: [PATCH] test(cctv): make the oversized Houston catalog fixture valid JSON The streamed oversized body was invalid JSON, so the loader returned nothing whether or not the byte cap applied. Pad a valid catalog with a usable camera instead, so only the cap can refuse it. --- src/data/cctvHouston.test.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/data/cctvHouston.test.mjs b/src/data/cctvHouston.test.mjs index 6af6ccdbf..82153152e 100644 --- a/src/data/cctvHouston.test.mjs +++ b/src/data/cctvHouston.test.mjs @@ -236,7 +236,11 @@ test('the catalog fetch refuses redirects and oversized bodies', async (t) => { t.mock.restoreAll(); t.mock.method(console, 'warn', () => {}); t.mock.method(globalThis, 'fetch', async () => { - const oversized = 'x'.repeat(HOUSTON_MAX_CATALOG_BYTES + 1024); + // Valid JSON with a usable camera, so only the byte cap can refuse it. + const oversized = JSON.stringify({ + cameras: [row()], + padding: 'x'.repeat(HOUSTON_MAX_CATALOG_BYTES + 1024), + }); return new Response( new ReadableStream({ start(controller) {