fix issues

This commit is contained in:
2025-12-26 11:49:20 +01:00
parent d08ec10b40
commit 68ae9da22a
44 changed files with 505 additions and 179 deletions

View File

@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach, vi, Mock } from 'vitest';
import { describe, it, expect, beforeEach, afterEach, vi, Mock } from 'vitest';
import {
CompleteDriverOnboardingUseCase,
type CompleteDriverOnboardingInput,
@@ -19,6 +19,8 @@ describe('CompleteDriverOnboardingUseCase', () => {
let output: { present: Mock } & UseCaseOutputPort<CompleteDriverOnboardingResult>;
beforeEach(() => {
vi.useFakeTimers();
vi.setSystemTime(new Date('2020-01-01T00:00:00.000Z'));
driverRepository = {
findById: vi.fn(),
create: vi.fn(),
@@ -36,6 +38,10 @@ describe('CompleteDriverOnboardingUseCase', () => {
);
});
afterEach(() => {
vi.useRealTimers();
});
it('should create driver successfully when driver does not exist', async () => {
const command: CompleteDriverOnboardingInput = {
userId: 'user-1',