Skip to content

Commit

Permalink
Clarify testing data
Browse files Browse the repository at this point in the history
  • Loading branch information
timvanoostrom committed Dec 17, 2024
1 parent de8d9ed commit d7ea667
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/server/services/adoptable-trash-containers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit d7ea667

Please sign in to comment.