Skip to content

Commit ce2aa73

Browse files
committed
chore: fix tests
1 parent 086fe0a commit ce2aa73

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/integration/datatypes.spec.ts

+34
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ export class TestParamsService {
157157
): string {
158158
return `limit:${limit}|prefix:${prefix}|expand:${expand}`;
159159
}
160+
@GET
161+
@Path('boolean-casing')
162+
public testBooleanCasing(
163+
@QueryParam('True') True?: boolean,
164+
@QueryParam('TRUE') TRUE?: boolean,
165+
@QueryParam('False') False?: boolean,
166+
@QueryParam('FALSE') FALSE?: boolean
167+
): string {
168+
return `True:${True}|TRUE:${TRUE}|False:${False}|FALSE:${FALSE}`;
169+
}
160170

161171
@POST
162172
@Path('upload')
@@ -478,6 +488,30 @@ describe('Data Types Tests', () => {
478488
}
479489
);
480490
});
491+
492+
it('should handle boolean parameters with different casings', (done) => {
493+
request(
494+
{
495+
url: 'http://localhost:5674/testparams/boolean-casing?True=True&TRUE=TRUE&False=False&FALSE=FALSE'
496+
},
497+
(error, response, body) => {
498+
expect(body).toEqual('True:true|TRUE:true|False:false|FALSE:false');
499+
done();
500+
}
501+
);
502+
});
503+
504+
it('should handle boolean parameters as undefined', (done) => {
505+
request(
506+
{
507+
url: 'http://localhost:5674/testparams/boolean-casing?True='
508+
},
509+
(error, response, body) => {
510+
expect(body).toEqual('True:false|TRUE:undefined|False:undefined|FALSE:undefined');
511+
done();
512+
}
513+
);
514+
});
481515
});
482516
describe('Download Service', () => {
483517
it('should return a file', (done) => {

0 commit comments

Comments
 (0)