From d7ea667da8b23bf1224ed99e1b0866a2efb7a960 Mon Sep 17 00:00:00 2001 From: Tim van Oostrom Date: Tue, 17 Dec 2024 13:15:04 +0100 Subject: [PATCH] Clarify testing data --- .../services/adoptable-trash-containers.test.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/server/services/adoptable-trash-containers.test.ts b/src/server/services/adoptable-trash-containers.test.ts index 241772baf..4674dc1f2 100644 --- a/src/server/services/adoptable-trash-containers.test.ts +++ b/src/server/services/adoptable-trash-containers.test.ts @@ -120,21 +120,19 @@ describe('fetchAdoptableTrashContainers', () => { expect(result.content?.tips).toHaveLength(0); }); - it('should return no tips if filteredFeatures length is 0', async () => { + it('should not return tips if there are no adoptable trashcontainers found within the given radius', async () => { (fetchBRP as Mock).mockResolvedValue(brpApiResponse); (fetchMyLocation as Mock).mockResolvedValue(locationApiResponse); - const [coord] = generateRandomPoints( - { lat: DEFAULT_LAT + 1, lng: DEFAULT_LNG }, - 90, // 90 meters - 1 - ); + // A coord outside of the radius from the Home location returned by fetchMyLocation + const COORD_LAT_OFFSET = 5; + const coordinates = [DEFAULT_LNG, DEFAULT_LAT + COORD_LAT_OFFSET]; (fetchDataset as Mock).mockResolvedValue( apiSuccessResult({ features: [ { - geometry: { coordinates: [coord.lng, coord.lat] }, + geometry: { coordinates }, properties: { datasetId: 'afvalcontainers', geadopteerd_ind: 'Nee',