Skip to content

Commit

Permalink
Add an explicit test for the GET case #2670
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed Apr 22, 2022
1 parent fefa7b2 commit be6e122
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions data-serving/data-service/test/controllers/case.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ describe('GET', () => {
const res = await request(app).get(`/api/cases/${c._id}`).expect(200);
expect(res.body[0].restrictedNotes).toBeUndefined();
});
it('should convert age bucket to age range', async () => {
const c = new Case(minimalCase);
const bucket = await AgeBucket.findOne({});
c.demographics.ageBuckets = [bucket!._id];
await c.save();
const res = await request(app).get(`/api/cases/${c._id}`).expect(200);
expect(res.body[0].demographics.ageRange.start).toEqual(bucket!.start);
expect(res.body[0].demographics.ageRange.end).toEqual(bucket!.end);
});
describe('list', () => {
it('should return 200 OK', () => {
return request(app)
Expand Down

0 comments on commit be6e122

Please sign in to comment.