EvalueTonSavoir/server/__tests__/image.test.js

67 lines
1.6 KiB
JavaScript
Raw Normal View History

/* eslint-disable */
2024-10-03 12:05:20 -04:00
// const request = require('supertest');
// const app = require('../app.js');
// // const app = require('../routers/images.js');
// const { response } = require('express');
2024-03-29 20:08:34 -04:00
2024-10-03 12:05:20 -04:00
// const BASE_URL = '/image'
2024-03-29 20:08:34 -04:00
2024-10-03 12:05:20 -04:00
describe.skip("POST /upload", () => {
2024-03-29 20:08:34 -04:00
describe("when the jwt is not sent", () => {
test('should respond with 401 status code', async () => {
const response = await request(app).post(BASE_URL + "/upload").send()
expect(response.statusCode).toBe(401)
})
// respond message Accès refusé. Aucun jeton fourni.
})
describe("when sent bad jwt", () => {
// respond with 401
// respond message Accès refusé. Jeton invalide.
})
describe("when sent no variables", () => {
// respond message Paramètre requis manquant.
// respond code 400
})
describe("when sent not an image file", () => {
// respond code 505
})
describe("when sent image file", () => {
// respond code 200
// json content type
// test("should reply with content type json", async () => {
// const response = await request(app).post(BASE_URL+'/upload').send()
// expect(response.headers['content-type']).toEqual(expect.stringContaining('json'))
// })
})
})
2024-10-03 12:05:20 -04:00
describe.skip("GET /get", () => {
2024-03-29 20:08:34 -04:00
describe("when not give id", () => {
})
describe("when not good id", () => {
})
describe("when good id", () => {
// respond code 200
// image content type
// response has something
})
2024-10-03 12:05:20 -04:00
})