Backend: code formatted

This commit is contained in:
2024-05-12 21:25:52 +02:00
parent fa25015472
commit bf791db47f
26 changed files with 574 additions and 469 deletions

View File

@@ -1,32 +1,32 @@
import supertest from 'supertest';
import { app } from '../src/app';
import { login } from './auth.test';
import supertest from "supertest";
import { app } from "../src/app";
import { login } from "./auth.test";
//import { addExam, delExam, editExam } from '../src/validators/beerValidator';
const request = supertest(app);
describe('POST /api/v1/review/add', () => {
const url = '/api/v1/review/add';
test('should drop 401 error', async () => {
describe("POST /api/v1/review/add", () => {
const url = "/api/v1/review/add";
test("should drop 401 error", async () => {
const res = await request.post(url).send({});
expect(res.statusCode).toBe(401);
});
test('should drop 400 ()', async () => {
test("should drop 400 ()", async () => {
const jwt = await login();
const res = await request.post(url).set('Cookie', jwt).send({});
const res = await request.post(url).set("Cookie", jwt).send({});
console.log("TEST", await res.body)
console.log("TEST", await res.body);
expect(res.statusCode).toBe(400);
});
// test('should drop 201', async () => {
// const jwt = await login();
// const res = await request.post(url).set('Cookie', jwt).send(addExam);
//
// expect(res.statusCode).toBe(201);
// });
// test('should drop 201', async () => {
// const jwt = await login();
// const res = await request.post(url).set('Cookie', jwt).send(addExam);
//
// expect(res.statusCode).toBe(201);
// });
});
//describe('GET /api/v1/beer/get', () => {
@@ -45,5 +45,3 @@ describe('POST /api/v1/review/add', () => {
// expect(res.statusCode).toBe(200);
// });
//});