test: fix indentation in change password tests and ensure server starts in get profile tests

This commit is contained in:
juancarmore 2025-06-09 23:46:35 +02:00
parent a86e1a4a08
commit b24a38ef55
2 changed files with 6 additions and 5 deletions

View File

@ -21,10 +21,10 @@ describe('Users API Tests', () => {
expect(response.status).toBe(200);
expect(response.body).toHaveProperty('message', 'Password changed successfully');
});
});
it('should fail when new password is not 4 characters long', async () => {
const response = await changePassword('123', adminCookie);
expectValidationError(response, 'newPassword', 'New password must be at least 4 characters long');
it('should fail when new password is not 4 characters long', async () => {
const response = await changePassword('123', adminCookie);
expectValidationError(response, 'newPassword', 'New password must be at least 4 characters long');
});
});
});

View File

@ -1,10 +1,11 @@
import { beforeAll, describe, expect, it } from '@jest/globals';
import { getProfile, loginUser } from '../../../helpers/request-helpers.js';
import { getProfile, loginUser, startTestServer } from '../../../helpers/request-helpers.js';
describe('Users API Tests', () => {
let adminCookie: string;
beforeAll(async () => {
startTestServer();
adminCookie = await loginUser();
});