website refactor
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest';
|
||||
import {
|
||||
GetLeagueFullConfigUseCase,
|
||||
type GetLeagueFullConfigInput,
|
||||
type GetLeagueFullConfigResult,
|
||||
type GetLeagueFullConfigErrorCode,
|
||||
} from './GetLeagueFullConfigUseCase';
|
||||
import type { LeagueRepository } from '../../domain/repositories/LeagueRepository';
|
||||
@@ -13,10 +12,10 @@ import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorC
|
||||
|
||||
describe('GetLeagueFullConfigUseCase', () => {
|
||||
let useCase: GetLeagueFullConfigUseCase;
|
||||
let leagueRepository: any;
|
||||
let seasonRepository: any;
|
||||
let leagueScoringConfigRepository: any;
|
||||
let gameRepository: any;
|
||||
let leagueRepository: { findById: Mock };
|
||||
let seasonRepository: { findByLeagueId: Mock };
|
||||
let leagueScoringConfigRepository: { findBySeasonId: Mock };
|
||||
let gameRepository: { findById: Mock };
|
||||
|
||||
beforeEach(() => {
|
||||
leagueRepository = {
|
||||
@@ -32,10 +31,12 @@ describe('GetLeagueFullConfigUseCase', () => {
|
||||
findById: vi.fn(),
|
||||
};
|
||||
|
||||
useCase = new GetLeagueFullConfigUseCase(leagueRepository,
|
||||
seasonRepository,
|
||||
leagueScoringConfigRepository,
|
||||
gameRepository);
|
||||
useCase = new GetLeagueFullConfigUseCase(
|
||||
leagueRepository as unknown as LeagueRepository,
|
||||
seasonRepository as unknown as SeasonRepository,
|
||||
leagueScoringConfigRepository as unknown as LeagueScoringConfigRepository,
|
||||
gameRepository as unknown as GameRepository
|
||||
);
|
||||
});
|
||||
|
||||
it('should return league config when league exists', async () => {
|
||||
|
||||
Reference in New Issue
Block a user