Skip to content

Commit

Permalink
test getProductsByCraving query
Browse files Browse the repository at this point in the history
Relates #192
  • Loading branch information
xIrusux committed Sep 19, 2019
1 parent 7bbbd56 commit 9938d27
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tests/db.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,13 @@ test("Check results are correct from getProductsByID query", t => {
t.end();
});
});

test("Check results are correct from getProductsByCraving query", t => {
const expected = [11, 12];

queries.getProductsByCraving(2).then(product => {
t.deepEqual(product[0].id, expected[0], "Correct product is returned");
t.deepEqual(product[4].id, expected[1], "Correct product is returned");
t.end();
});
});

0 comments on commit 9938d27

Please sign in to comment.