refactor(core): Make controller constructors consistent (no-changelog) (#7015)

This commit is contained in:
Iván Ovejero
2023-08-25 13:23:22 +02:00
committed by GitHub
parent 07d3633a05
commit 87cf1d9c1b
10 changed files with 145 additions and 270 deletions

View File

@@ -9,20 +9,14 @@ import { AUTH_COOKIE_NAME } from '@/constants';
import { BadRequestError } from '@/ResponseHelper';
import type { AuthenticatedRequest, MeRequest } from '@/requests';
import { badPasswords } from '../shared/testData';
import { UserService } from '@/services/user.service';
import Container from 'typedi';
import type { UserService } from '@/services/user.service';
describe('MeController', () => {
const logger = mock<ILogger>();
const externalHooks = mock<IExternalHooksClass>();
const internalHooks = mock<IInternalHooksClass>();
const userService = mock<UserService>();
Container.set(UserService, userService);
const controller = new MeController({
logger,
externalHooks,
internalHooks,
});
const controller = new MeController(logger, externalHooks, internalHooks, userService);
describe('updateCurrentUser', () => {
it('should throw BadRequestError if email is missing in the payload', async () => {