fix issues in core
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user