Skip to content

Commit

Permalink
Added extra check to solve huisvuil being seen as grof vuil #178
Browse files Browse the repository at this point in the history
  • Loading branch information
robertraaijmakers committed Feb 24, 2025
1 parent 3384076 commit f926de5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
10 changes: 8 additions & 2 deletions lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ export function verifyByName(activityDates: ActivityDates[], className: string,
description.indexOf('etensresten') !== -1 ||
description.indexOf('residual') !== -1 ||
description.indexOf('grey') !== -1 ||
description.indexOf('sortibak') !== -1
description.indexOf('sortibak') !== -1 ||
description.indexOf('huisvuil') !== -1
) {
addDate(activityDates, TrashType.REST, date, icon, localDescription, color);
foundType = true;
Expand Down Expand Up @@ -210,7 +211,12 @@ export function verifyByName(activityDates: ActivityDates[], className: string,
foundType = true;
}

if (description.indexOf('grof') !== -1 || description.indexOf('vuil') !== -1 || description.indexOf('pruning') !== -1 || description.indexOf('bulky') !== -1) {
if (
description.indexOf('grof') !== -1 ||
(description.indexOf('vuil') !== -1 && description.indexOf('huisvuil') === -1) ||
description.indexOf('pruning') !== -1 ||
description.indexOf('bulky') !== -1
) {
addDate(activityDates, TrashType.GROF, date, icon, localDescription, color);
foundType = true;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/trashapis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ export class TrashApis {
description = entry.fraction.name.fr.toLowerCase().trim();
}

this.#log(description);

verifyByName(fDates, '', description, dateStr);
}

Expand Down
14 changes: 7 additions & 7 deletions test/trashApiTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe('TrashApiSvr', function () {
assert.equal(isValid, true);
});
});
*/
describe('TrashApiRov', function () {
/*it('API - Afvalwijzer - Rova', async function () {
const apiSettings: ApiSettings = {
Expand All @@ -236,7 +236,7 @@ describe('TrashApiRov', function () {
const result = await testAPI(apiSettings);
const isValid = validateApiResults(apiSettings, result);
assert.equal(isValid, true);
});*/
});
it('API - Afvalwijzer - Rova - Niet bestaand adres', async function () {
const apiSettings: ApiSettings = {
Expand All @@ -254,7 +254,7 @@ describe('TrashApiRov', function () {
assert.equal(isValid, false);
});
});
/*
describe('TrashApiRad', function () {
it('API - RAD 2', async function () {
const apiSettings: ApiSettings = {
Expand Down Expand Up @@ -285,10 +285,10 @@ describe('TrashApiRad', function () {
const isValid = validateApiResults(apiSettings, result);
assert.equal(isValid, true);
});
});
});*/

describe('TrashApiRecbe', function () {
it('API - Afvalkalender Recycle BE - 1', async function () {
/*it('API - Afvalkalender Recycle BE - 1', async function () {
const apiSettings: ApiSettings = {
zipcode: '8930',
housenumber: '58',
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('TrashApiRecbe', function () {
const result = await testAPI(apiSettings);
const isValid = validateApiResults(apiSettings, result);
assert.equal(isValid, true);
});
});*/

it('API - RECYCLE BE 5', async function () {
const apiSettings: ApiSettings = {
Expand All @@ -363,7 +363,7 @@ describe('TrashApiRecbe', function () {
assert.equal(isValid, true);
});
});
/*
describe('TrashApiAvr', function () {
it('API - Afvalkalender AVRI', async function () {
const apiSettings: ApiSettings = {
Expand Down

0 comments on commit f926de5

Please sign in to comment.