From 54fb74c47f59f07a7a031dbedb3968b525753480 Mon Sep 17 00:00:00 2001 From: Robert Raaijmakers Date: Thu, 27 Feb 2025 17:20:12 +0100 Subject: [PATCH] Fixed finding RESTafval voor Den Haag #231 --- lib/helpers.ts | 2 +- test/trashApiTests.ts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/helpers.ts b/lib/helpers.ts index ca107e6..4914275 100644 --- a/lib/helpers.ts +++ b/lib/helpers.ts @@ -264,7 +264,7 @@ export function processWasteData(afvalstromenResponse: any, kalenderResponse: an if (checkTitle.includes('GFT') || checkTitle.includes('GROENTE') || checkTitle.includes('GROENE')) collectionType = TrashType.GFT; if (checkTitle.includes('PBD') || checkTitle.includes('PMD') || checkTitle.includes('PLASTIC')) collectionType = TrashType.PMD; if (checkTitle.includes('PAPIER')) collectionType = TrashType.PAPIER; - if (checkTitle.includes('RESTAFVAL') || checkTitle.includes('GRIJZE')) collectionType = TrashType.REST; + if (checkTitle.includes('REST') || checkTitle.includes('RESTAFVAL') || checkTitle.includes('GRIJZE')) collectionType = TrashType.REST; if (checkTitle.includes('TEXTIEL')) collectionType = TrashType.TEXTIEL; if (checkTitle.includes('KERSTBOOM') || checkTitle.includes('KERSTBOMEN')) collectionType = TrashType.KERSTBOOM; if (checkTitle.includes('GROF')) collectionType = TrashType.GROF; diff --git a/test/trashApiTests.ts b/test/trashApiTests.ts index b3c7e6a..5d0c9fd 100644 --- a/test/trashApiTests.ts +++ b/test/trashApiTests.ts @@ -381,6 +381,23 @@ describe('TrashApiAvr', function () { }); }); +describe('HuisvuilDenHaag', function () { + it('API - Huisvuil Den Haag', async function () { + const apiSettings: ApiSettings = { + zipcode: '2492NN', + housenumber: '9', + country: 'NL', + apiId: 'hkdh', + cleanApiId: '', + streetname: '', + }; + + const result = await testAPI(apiSettings); + const isValid = validateApiResults(apiSettings, result); + assert.equal(isValid, true); + }); +}); + describe('TrashApiRd4', function () { it('API - RD4', async function () { const apiSettings: ApiSettings = {