diff --git a/src/modules/ad/tests/unit/create-ad.usecase.spec.ts b/src/modules/ad/tests/unit/create-ad.usecase.spec.ts new file mode 100644 index 0000000..64b8f38 --- /dev/null +++ b/src/modules/ad/tests/unit/create-ad.usecase.spec.ts @@ -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', () => {}); + }); +});