From cedfebd8a2100db4a934c90218ca81c9a12ce2a4 Mon Sep 17 00:00:00 2001 From: Kelley Glenn Date: Mon, 23 Feb 2026 23:42:08 -0800 Subject: [PATCH] fix(api): update bbox test for video_count > 0 filter Location service now filters locations with zero videos from bbox queries. Update the test to query SF Bay Area seed data (which has video_count > 0) instead of creating a new location without videos. Refs video-service#49, location-service#17 Co-Authored-By: Claude Opus 4.6 --- api/tests/location-service.spec.ts | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/api/tests/location-service.spec.ts b/api/tests/location-service.spec.ts index 3cb552c..3ff2aab 100644 --- a/api/tests/location-service.spec.ts +++ b/api/tests/location-service.spec.ts @@ -98,28 +98,11 @@ test.describe("Location Service API", () => { test.describe("List Locations (Bounding Box)", () => { test("returns locations within bounding box", async ({ request }) => { - const user = await createTestUser(request); - - // Create a location with specific coordinates we can verify - const testLat = 33.45; - const testLng = -112.07; - const createdLocation = await createTestLocation( - request, - user.accessToken, - { - displayName: `Phoenix Test Location ${Date.now()}`, - latitude: testLat, - longitude: testLng, - city: "Phoenix", - state: "AZ", - }, - ); - createdLocationIds.push(createdLocation.id); - - // Query with bounding box that definitely includes our test location + // Query SF Bay Area bounding box — seed data locations have video_count > 0 + // (locations with zero approved videos are filtered out) const response = await request.get(`${API_URL}/locations`, { params: { - bbox: "-112.2,33.3,-111.9,33.6", // minLng,minLat,maxLng,maxLat + bbox: "-122.6,37.2,-121.8,38.0", // minLng,minLat,maxLng,maxLat (SF Bay Area) }, }); @@ -129,9 +112,10 @@ test.describe("Location Service API", () => { expect(body.locations).toBeInstanceOf(Array); expect(body.count).toBeGreaterThanOrEqual(1); - // Verify our specific location is in the results + // Verify seed location "San Francisco City Hall" is in the results const found = body.locations.some( - (loc: { id: string }) => loc.id === createdLocation.id, + (loc: { id: string }) => + loc.id === "20000000-0000-0000-0000-000000000001", ); expect(found).toBeTruthy(); });