using helmet + new name for some endpoints

This commit is contained in:
xfarrow
2024-03-06 14:49:39 +01:00
parent 7dec60a9c4
commit 0fe3bc2ec6
2 changed files with 15 additions and 9 deletions

View File

@ -2,24 +2,28 @@
const request = require('supertest');
const app = require('../src/app');
require('dotenv').config({ path: '../src/.env' });
require('dotenv').config({
path: '../src/.env'
});
describe('Person Tests', () => {
test('Correct registration', async () => {
const response = await request(app)
.post('/api/register')
.post('/api/persons')
.send({
email: 'johntestdoe@mail.org',
password: 'password',
display_name: 'John Doe'
});
expect(response.status).toBe(200);
expect(response.body).toEqual({ activationLink: expect.any(String) });
expect(response.body).toEqual({
activationLink: expect.any(String)
});
});
test('Incorrect registration', async () => {
const response = await request(app)
.post('/api/register')
.post('/api/persons')
.send({
email: 'this is not an email',
password: 'password',
@ -27,4 +31,4 @@ describe('Person Tests', () => {
});
expect(response.status).toBe(400);
});
});
});