fix issues in core

This commit is contained in:
2025-12-23 15:38:50 +01:00
parent df5c20c5cc
commit 120d3bb1a1
125 changed files with 1005 additions and 793 deletions

View File

@@ -9,6 +9,7 @@ import type { ILeagueRepository } from '../../domain/repositories/ILeagueReposit
import type { ILeagueMembershipRepository } from '../../domain/repositories/ILeagueMembershipRepository';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
import type { Logger } from '@core/shared/application';
describe('GetLeagueAdminPermissionsUseCase', () => {
let mockLeagueRepo: ILeagueRepository;
@@ -16,12 +17,12 @@ describe('GetLeagueAdminPermissionsUseCase', () => {
let mockFindById: Mock;
let mockGetMembership: Mock;
let output: UseCaseOutputPort<GetLeagueAdminPermissionsResult> & { present: Mock };
const logger = {
const logger: Logger = {
debug: vi.fn(),
info: vi.fn(),
warn: vi.fn(),
error: vi.fn(),
} as any;
};
beforeEach(() => {
mockFindById = vi.fn();
@@ -122,7 +123,7 @@ describe('GetLeagueAdminPermissionsUseCase', () => {
});
it('returns admin permissions for admin role and calls output once', async () => {
const league = { id: 'league1' } as any;
const league = { id: 'league1' } as unknown as { id: string };
mockFindById.mockResolvedValue(league);
mockGetMembership.mockResolvedValue({ status: 'active', role: 'admin' });
@@ -144,7 +145,7 @@ describe('GetLeagueAdminPermissionsUseCase', () => {
});
it('returns admin permissions for owner role and calls output once', async () => {
const league = { id: 'league1' } as any;
const league = { id: 'league1' } as unknown as { id: string };
mockFindById.mockResolvedValue(league);
mockGetMembership.mockResolvedValue({ status: 'active', role: 'owner' });