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,7 +9,6 @@ import type { ILeagueRepository } from '../../domain/repositories/ILeagueReposit
import type { ILeagueMembershipRepository } from '../../domain/repositories/ILeagueMembershipRepository';
import type { Logger, UseCaseOutputPort } from '@core/shared/application';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
import { Result } from '@core/shared/application/Result';
interface LeagueRepositoryMock {
findById: Mock;
@@ -31,13 +30,13 @@ describe('RejectLeagueJoinRequestUseCase', () => {
beforeEach(() => {
leagueRepository = {
findById: vi.fn(),
} as unknown as ILeagueRepository as any;
};
leagueMembershipRepository = {
getMembership: vi.fn(),
getJoinRequests: vi.fn(),
removeJoinRequest: vi.fn(),
} as unknown as ILeagueMembershipRepository as any;
};
logger = {
debug: vi.fn(),
@@ -87,7 +86,9 @@ describe('RejectLeagueJoinRequestUseCase', () => {
expect(result.isOk()).toBe(true);
expect(result.unwrap()).toBeUndefined();
expect(output.present).toHaveBeenCalledTimes(1);
const presented = output.present.mock.calls[0][0] as RejectLeagueJoinRequestResult;
const presentedRaw = output.present.mock.calls[0]?.[0];
expect(presentedRaw).toBeDefined();
const presented = presentedRaw as RejectLeagueJoinRequestResult;
expect(presented.leagueId).toBe('league-1');
expect(presented.requestId).toBe('req-1');
expect(presented.status).toBe('rejected');