it('check request \'by\' query param', async function() {
this.by = 'gender';
this.server.get('/patients/stats', (_schema: any, request: any) => {
expect(request.queryParams.by).to.equal(this.by + 'sdfdg');
return {
items: [
{
label: 'Male',
count: 157
},
{
label: 'Female',
count: 144
}
],
meta: {
total: 301
}
}
});
await render(hbs`<Patients::Stats @by={{this.by}} />`);
});
The expect(request.queryParams.by).to.equal(this.by + 'sdfdg'); should not pass the test because the query param (request.queryParams.by) is equal to ‘gender’. But the test somehow still passed…
5 posts - 2 participants