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

@@ -12,7 +12,6 @@ import { OwnerController } from '@/controllers';
import { badPasswords } from '../shared/testData';
import { AUTH_COOKIE_NAME } from '@/constants';
import { UserService } from '@/services/user.service';
import Container from 'typedi';
import { mockInstance } from '../../integration/shared/utils';
describe('OwnerController', () => {
@@ -20,16 +19,14 @@ describe('OwnerController', () => {
const logger = mock<ILogger>();
const internalHooks = mock<IInternalHooksClass>();
const userService = mockInstance(UserService);
Container.set(UserService, userService);
const settingsRepository = mock<SettingsRepository>();
const controller = new OwnerController({
const controller = new OwnerController(
config,
logger,
internalHooks,
repositories: {
Settings: settingsRepository,
},
});
settingsRepository,
userService,
);
describe('setupOwner', () => {
it('should throw a BadRequestError if the instance owner is already setup', async () => {