Added: tests for reviews, Reviews GET API endpoint; Fixed: tests for beers

This commit was merged in pull request #16.
This commit is contained in:
2024-05-12 22:15:54 +02:00
parent bf791db47f
commit 1c97262ee3
3 changed files with 106 additions and 25 deletions

View File

@@ -19,6 +19,33 @@ describe("POST /api/v1/beer/add", () => {
expect(res.statusCode).toBe(400);
});
test("should drop 400 (name)", async () => {
const jwt = await login();
const body: any = { ...addExam };
delete body.name;
const res = await request.post(url).set("Cookie", jwt).send(body);
expect(res.statusCode).toBe(400);
});
test("should drop 400 (degree)", async () => {
const jwt = await login();
const body: any = { ...addExam };
delete body.degree;
const res = await request.post(url).set("Cookie", jwt).send(body);
expect(res.statusCode).toBe(400);
});
test("should drop 400 (packaging)", async () => {
const jwt = await login();
const body: any = { ...addExam };
delete body.packaging;
const res = await request.post(url).set("Cookie", jwt).send(body);
expect(res.statusCode).toBe(400);
});
test("should drop 400 (brand)", async () => {
const jwt = await login();
const body: any = { ...addExam };