creating ad and adresses mocks

This commit is contained in:
Grégoire Chevalier 2023-05-04 16:55:42 +02:00
parent aa24bae84c
commit 9f930e1395
1 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,49 @@
import { classes } from '@automapper/classes';
import { AutomapperModule } from '@automapper/nestjs';
import { Ad } from '../../domain/entities/ad';
const mockAddress1: Address = {
position: 0,
lon: '48.68944505415954',
lat: '6.176510296462267',
houseNumber: 5,
street: 'Avenue Foch',
locality: 'Nancy',
postalCode: '75000',
country: 'France',
type: 'LOCALITY',
};
const mockAddress2: Address = {
position: 0,
lon: '48.8566',
lat: '2.3522',
locality: 'Paris',
postalCode: '75000',
country: 'France',
type: 'LOCALITY',
};
const newAdRequest: CreateAdRequest = {
userUuid: 'a83e804a-e910-4c10-917f-5274533022b0',
driver: true,
passenger: false,
frequency: 'RECURRENT',
fromDate: new Date('01-05-2023'),
toDate: new Date('20-08-2023'),
tueTime: new Date(''),
wedTime: new Date(''),
seatsPassenger: 2,
adresses: [mockAddress1],
};
const mockMessager = {
publish: jest.fn().mockImplementation(),
};
describe('CreateAdUseCase', () => {
it('should be defined', () => {});
describe('execution', () => {
it('should create an new ad', () => {});
it('should throw an error if the ad already exists', () => {});
});
});