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