feat(users,professors): add promote student to professor and full student profile aggregation

This commit is contained in:
2026-08-24 22:52:38 +03:30
parent 282dd42422
commit dca7250be0
8 changed files with 401 additions and 2 deletions
@@ -0,0 +1,24 @@
'use strict';
const { describe, it } = require('node:test');
const assert = require('node:assert/strict');
const userService = require('./userService');
const professorService = require('../professors/professorService');
describe('Student Profile and Professor Promotion Service Exports', () => {
it('exports getUserFullProfile and promoteToProfessor in userService', () => {
assert.equal(typeof userService.getUserFullProfile, 'function');
assert.equal(typeof userService.promoteToProfessor, 'function');
});
it('exports createProfessorFromUser in professorService', () => {
assert.equal(typeof professorService.createProfessorFromUser, 'function');
});
it('throws validation error when userId is missing in createProfessorFromUser', async () => {
await assert.rejects(
() => professorService.createProfessorFromUser(null),
(err) => err.errorCode === 'VALIDATION_FAILED' || err.statusCode === 400
);
});
});