Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MelvLee committed Jun 19, 2024
2 parents 39c266f + be9dca5 commit 7dc9bc2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion features/step_definitions/als-stepdefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ const apiEndpointPrefixMap = new Map([
['personen', 'brp'],
['reisdocumenten', 'reisdocumenten'],
['verblijfplaatshistorie', 'brphistorie'],
['bestaat-niet', 'brp']
// niet bestaande endpoints
['ingezetenen', 'brp'],
['paspoorten', 'reisdocumenten'],
['verblijfhistorie', 'brphistorie']
]);

When(/^([a-zA-Z-]*) wordt gezocht met de volgende parameters$/, async function (endpoint, dataTable) {
Expand Down
11 changes: 7 additions & 4 deletions features/step_definitions/requestHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,21 @@ function createRequestBody(dataTable) {
return !param.naam.startsWith("header:");
})
.forEach(function(param) {
if (isArrayParameter(type, param)) {
if (param.naam === '' && param.waarde === '') {
// do nothing
}
else if (isArrayParameter(type, param)) {
requestBody[param.naam] = param.waarde === ''
? []
: param.waarde.split(',');
}
else if(param.naam === 'burgerservicenummer (als string)') {
else if (param.naam === 'burgerservicenummer (als string)') {
requestBody['burgerservicenummer'] = param.waarde;
}
else if(param.naam === 'fields (als string)') {
else if (param.naam === 'fields (als string)') {
requestBody['fields'] = param.waarde;
}
else if(param.waarde === '(131 maal aNummer)') {
else if (param.waarde === '(131 maal aNummer)') {
requestBody[param.naam] = [];
for(let count=0; count<=131; count++) {
requestBody[param.naam].push('aNummer');
Expand Down

0 comments on commit 7dc9bc2

Please sign in to comment.