2021-08-30 16:23:19 +02:00
|
|
|
const supertest = require("supertest");
|
|
|
|
const request = supertest("http://localhost:3001");
|
|
|
|
|
2021-09-01 22:14:06 +02:00
|
|
|
describe("/api/auth/register", () => {
|
2021-08-30 16:23:19 +02:00
|
|
|
describe("POST", () => {
|
|
|
|
test("without body", async () => {
|
|
|
|
const response = await request.post("/api/auth/register").send({});
|
2021-09-01 22:14:06 +02:00
|
|
|
|
2021-08-30 16:23:19 +02:00
|
|
|
expect(response.statusCode).toBe(400);
|
|
|
|
});
|
|
|
|
test("with body", async () => {
|
|
|
|
const response = await request.post("/api/auth/register").send({
|
|
|
|
fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw",
|
|
|
|
email: "qo8etzvaf@gmail.com",
|
|
|
|
username: "qp39gr98",
|
|
|
|
password: "wtp9gep9gw",
|
|
|
|
invite: null,
|
|
|
|
consent: true,
|
|
|
|
date_of_birth: "2000-04-04",
|
|
|
|
gift_code_sku_id: null,
|
|
|
|
captcha_key: null
|
|
|
|
});
|
2021-09-01 22:14:06 +02:00
|
|
|
|
2021-08-30 16:23:19 +02:00
|
|
|
expect(response.statusCode).toBe(200);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|