website refactor
This commit is contained in:
@@ -8,8 +8,8 @@ import { UserRating } from '../../domain/value-objects/UserRating';
|
||||
import { RatingEventId } from '../../domain/value-objects/RatingEventId';
|
||||
|
||||
describe('AppendRatingEventsUseCase', () => {
|
||||
let mockEventRepo: Partial<IRatingEventRepository>;
|
||||
let mockRatingRepo: Partial<IUserRatingRepository>;
|
||||
let mockEventRepo: Partial<RatingEventRepository>;
|
||||
let mockRatingRepo: Partial<UserRatingRepository>;
|
||||
|
||||
beforeEach(() => {
|
||||
mockEventRepo = {
|
||||
@@ -24,16 +24,16 @@ describe('AppendRatingEventsUseCase', () => {
|
||||
|
||||
it('should be constructed with repositories', () => {
|
||||
const useCase = new AppendRatingEventsUseCase(
|
||||
mockEventRepo as IRatingEventRepository,
|
||||
mockRatingRepo as IUserRatingRepository,
|
||||
mockEventRepo as RatingEventRepository,
|
||||
mockRatingRepo as UserRatingRepository,
|
||||
);
|
||||
expect(useCase).toBeInstanceOf(AppendRatingEventsUseCase);
|
||||
});
|
||||
|
||||
it('should handle empty input (no events)', async () => {
|
||||
const useCase = new AppendRatingEventsUseCase(
|
||||
mockEventRepo as IRatingEventRepository,
|
||||
mockRatingRepo as IUserRatingRepository,
|
||||
mockEventRepo as RatingEventRepository,
|
||||
mockRatingRepo as UserRatingRepository,
|
||||
);
|
||||
|
||||
const input: AppendRatingEventsInput = {
|
||||
@@ -50,8 +50,8 @@ describe('AppendRatingEventsUseCase', () => {
|
||||
|
||||
it('should create and save events from direct input', async () => {
|
||||
const useCase = new AppendRatingEventsUseCase(
|
||||
mockEventRepo as IRatingEventRepository,
|
||||
mockRatingRepo as IUserRatingRepository,
|
||||
mockEventRepo as RatingEventRepository,
|
||||
mockRatingRepo as UserRatingRepository,
|
||||
);
|
||||
|
||||
const input: AppendRatingEventsInput = {
|
||||
@@ -79,8 +79,8 @@ describe('AppendRatingEventsUseCase', () => {
|
||||
|
||||
it('should create events from race results using factory', async () => {
|
||||
const useCase = new AppendRatingEventsUseCase(
|
||||
mockEventRepo as IRatingEventRepository,
|
||||
mockRatingRepo as IUserRatingRepository,
|
||||
mockEventRepo as RatingEventRepository,
|
||||
mockRatingRepo as UserRatingRepository,
|
||||
);
|
||||
|
||||
const input: AppendRatingEventsInput = {
|
||||
@@ -108,8 +108,8 @@ describe('AppendRatingEventsUseCase', () => {
|
||||
|
||||
it('should handle multiple race results', async () => {
|
||||
const useCase = new AppendRatingEventsUseCase(
|
||||
mockEventRepo as IRatingEventRepository,
|
||||
mockRatingRepo as IUserRatingRepository,
|
||||
mockEventRepo as RatingEventRepository,
|
||||
mockRatingRepo as UserRatingRepository,
|
||||
);
|
||||
|
||||
const input: AppendRatingEventsInput = {
|
||||
@@ -129,8 +129,8 @@ describe('AppendRatingEventsUseCase', () => {
|
||||
|
||||
it('should handle DNF status', async () => {
|
||||
const useCase = new AppendRatingEventsUseCase(
|
||||
mockEventRepo as IRatingEventRepository,
|
||||
mockRatingRepo as IUserRatingRepository,
|
||||
mockEventRepo as RatingEventRepository,
|
||||
mockRatingRepo as UserRatingRepository,
|
||||
);
|
||||
|
||||
const input: AppendRatingEventsInput = {
|
||||
@@ -159,8 +159,8 @@ describe('AppendRatingEventsUseCase', () => {
|
||||
};
|
||||
|
||||
const useCase = new AppendRatingEventsUseCase(
|
||||
mockEventRepo as IRatingEventRepository,
|
||||
mockRatingRepo as IUserRatingRepository,
|
||||
mockEventRepo as RatingEventRepository,
|
||||
mockRatingRepo as UserRatingRepository,
|
||||
);
|
||||
|
||||
const input: AppendRatingEventsInput = {
|
||||
|
||||
Reference in New Issue
Block a user