This commit is contained in:
2025-12-16 21:05:01 +01:00
parent f61e3a4e5a
commit 7532c7ed6d
207 changed files with 7861 additions and 2606 deletions

View File

@@ -1,6 +1,5 @@
import { describe, it, expect, beforeEach, vi, Mock } from 'vitest';
import { CreateTeamUseCase } from './CreateTeamUseCase';
import type { CreateTeamCommandDTO } from '../dto/CreateTeamCommandDTO';
import { CreateTeamUseCase, type CreateTeamCommandDTO } from './CreateTeamUseCase';
import type { ITeamRepository } from '../../domain/repositories/ITeamRepository';
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
import type { Logger } from '@core/shared/application';
@@ -98,7 +97,7 @@ describe('CreateTeamUseCase', () => {
const result = await useCase.execute(command);
expect(result.isErr()).toBe(true);
expect(result.unwrapErr().message).toBe('Driver already belongs to a team');
expect(result.unwrapErr().details.message).toBe('Driver already belongs to a team');
expect(teamRepository.create).not.toHaveBeenCalled();
expect(membershipRepository.saveMembership).not.toHaveBeenCalled();
});
@@ -118,6 +117,6 @@ describe('CreateTeamUseCase', () => {
const result = await useCase.execute(command);
expect(result.isErr()).toBe(true);
expect(result.unwrapErr().message).toBe('DB error');
expect(result.unwrapErr().details.message).toBe('DB error');
});
});