Cleanup after initial plan
This commit is contained in:
parent
d2a7e652b3
commit
245520fb50
53 changed files with 6733 additions and 621 deletions
|
|
@ -129,8 +129,18 @@ describe('nutrition-target.routes', () => {
|
|||
});
|
||||
|
||||
describe('GET /api/v1/households/:householdId/nutrition-targets/history', () => {
|
||||
it('returns historical targets', async () => {
|
||||
mockFindAllByUser.mockResolvedValue([makeTarget({ isActive: false }), makeTarget()]);
|
||||
it('returns historical targets with optional fields and object _id', async () => {
|
||||
mockFindAllByUser.mockResolvedValue([
|
||||
makeTarget({
|
||||
_id: { toString: () => 'target-1' },
|
||||
isActive: false,
|
||||
fiberG: 30,
|
||||
sugarG: 50,
|
||||
sodiumMg: 2000,
|
||||
createdAt: new Date(),
|
||||
}),
|
||||
makeTarget()
|
||||
]);
|
||||
|
||||
const res = await app.inject({
|
||||
method: 'GET',
|
||||
|
|
@ -141,6 +151,8 @@ describe('nutrition-target.routes', () => {
|
|||
expect(res.statusCode).toBe(200);
|
||||
const body = res.json();
|
||||
expect(body).toHaveLength(2);
|
||||
expect(body[0].fiberG).toBe(30);
|
||||
expect(body[0]._id).toBe('target-1');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue