Merge branch 'fixTests' into 'main'

Fix tests

See merge request v3/service/ad!20
This commit is contained in:
Sylvain Briat 2023-08-25 07:37:27 +00:00
commit 1a881572c2
11 changed files with 53 additions and 53 deletions

View File

@ -70,16 +70,16 @@ describe('Ad Repository', () => {
};
const originWaypoint = {
position: 0,
lon: 43.7102,
lat: 7.262,
lat: 43.7102,
lon: 7.262,
locality: "'Nice'",
postalCode: "'06000'",
country: "'France'",
};
const destinationWaypoint = {
position: 1,
lon: 43.2965,
lat: 5.3698,
lat: 43.2965,
lon: 5.3698,
locality: "'Marseille'",
postalCode: "'13000'",
country: "'France'",
@ -211,8 +211,8 @@ describe('Ad Repository', () => {
postalCode: '06000',
country: 'France',
coordinates: {
lon: 43.7102,
lat: 7.262,
lat: 43.7102,
lon: 7.262,
},
},
},
@ -223,8 +223,8 @@ describe('Ad Repository', () => {
postalCode: '13000',
country: 'France',
coordinates: {
lon: 43.2965,
lat: 5.3698,
lat: 43.2965,
lon: 5.3698,
},
},
},
@ -299,8 +299,8 @@ describe('Ad Repository', () => {
postalCode: '06000',
country: 'France',
coordinates: {
lon: 43.7102,
lat: 7.262,
lat: 43.7102,
lon: 7.262,
},
},
},
@ -311,8 +311,8 @@ describe('Ad Repository', () => {
postalCode: '13000',
country: 'France',
coordinates: {
lon: 43.2965,
lat: 5.3698,
lat: 43.2965,
lon: 5.3698,
},
},
},

View File

@ -15,8 +15,8 @@ const originWaypointProps: WaypointProps = {
postalCode: '54000',
country: 'France',
coordinates: {
lon: 48.689445,
lat: 6.17651,
lat: 48.689445,
lon: 6.17651,
},
},
};
@ -27,8 +27,8 @@ const destinationWaypointProps: WaypointProps = {
postalCode: '75000',
country: 'France',
coordinates: {
lon: 48.8566,
lat: 2.3522,
lat: 48.8566,
lon: 2.3522,
},
},
};
@ -339,8 +339,8 @@ describe('Ad entity create', () => {
postalCode: '54000',
country: 'France',
coordinates: {
lon: 48.689445,
lat: 6.17651,
lat: 48.689445,
lon: 6.17651,
},
},
},
@ -351,8 +351,8 @@ describe('Ad entity create', () => {
postalCode: '75000',
country: 'France',
coordinates: {
lon: 48.8566,
lat: 2.3522,
lat: 48.8566,
lon: 2.3522,
},
},
},

View File

@ -9,8 +9,8 @@ describe('Address value object', () => {
postalCode: '54000',
country: 'France',
coordinates: {
lon: 48.689445,
lat: 6.17651,
lat: 48.689445,
lon: 6.17651,
},
});
expect(addressVO.houseNumber).toBe('5');
@ -18,7 +18,7 @@ describe('Address value object', () => {
expect(addressVO.locality).toBe('Nancy');
expect(addressVO.postalCode).toBe('54000');
expect(addressVO.country).toBe('France');
expect(addressVO.coordinates.lon).toBe(48.689445);
expect(addressVO.coordinates.lat).toBe(48.689445);
expect(addressVO.name).toBeUndefined();
});
});

View File

@ -3,10 +3,10 @@ import { Coordinates } from '@modules/ad/core/domain/value-objects/coordinates.v
describe('Coordinates value object', () => {
it('should create a coordinates value object', () => {
const coordinatesVO = new Coordinates({
lon: 48.689445,
lat: 6.17651,
lat: 48.689445,
lon: 6.17651,
});
expect(coordinatesVO.lon).toBe(48.689445);
expect(coordinatesVO.lat).toBe(6.17651);
expect(coordinatesVO.lat).toBe(48.689445);
expect(coordinatesVO.lon).toBe(6.17651);
});
});

View File

@ -18,8 +18,8 @@ import { DateTimeTransformerPort } from '@modules/ad/core/application/ports/date
const originWaypoint: WaypointDto = {
position: 0,
lon: 48.689445,
lat: 6.17651,
lat: 48.689445,
lon: 6.17651,
houseNumber: '5',
street: 'Avenue Foch',
locality: 'Nancy',
@ -28,8 +28,8 @@ const originWaypoint: WaypointDto = {
};
const destinationWaypoint: WaypointDto = {
position: 1,
lon: 48.8566,
lat: 2.3522,
lat: 48.8566,
lon: 2.3522,
locality: 'Paris',
postalCode: '75000',
country: 'France',

View File

@ -19,8 +19,8 @@ const originWaypointProps: WaypointProps = {
postalCode: '54000',
country: 'France',
coordinates: {
lon: 48.689445,
lat: 6.17651,
lat: 48.689445,
lon: 6.17651,
},
},
};
@ -31,8 +31,8 @@ const destinationWaypointProps: WaypointProps = {
postalCode: '75000',
country: 'France',
coordinates: {
lon: 48.8566,
lat: 2.3522,
lat: 48.8566,
lon: 2.3522,
},
},
};

View File

@ -11,8 +11,8 @@ describe('Waypoint value object', () => {
postalCode: '54000',
country: 'France',
coordinates: {
lon: 48.689445,
lat: 6.17651,
lat: 48.689445,
lon: 6.17651,
},
},
});

View File

@ -11,8 +11,8 @@ import { Test, TestingModule } from '@nestjs/testing';
const originWaypoint: WaypointDto = {
position: 0,
lon: 48.689445,
lat: 6.17651,
lat: 48.689445,
lon: 6.17651,
houseNumber: '5',
street: 'Avenue Foch',
locality: 'Nancy',
@ -21,8 +21,8 @@ const originWaypoint: WaypointDto = {
};
const destinationWaypoint: WaypointDto = {
position: 1,
lon: 48.8566,
lat: 2.3522,
lat: 48.8566,
lon: 2.3522,
locality: 'Paris',
postalCode: '75000',
country: 'France',

View File

@ -44,8 +44,8 @@ const mockAdMapper = {
waypoints: [
{
position: 0,
lon: 48.689445,
lat: 6.17651,
lat: 48.689445,
lon: 6.17651,
houseNumber: '5',
street: 'Avenue Foch',
locality: 'Nancy',
@ -54,8 +54,8 @@ const mockAdMapper = {
},
{
position: 1,
lon: 48.8566,
lat: 2.3522,
lat: 48.8566,
lon: 2.3522,
locality: 'Paris',
postalCode: '75000',
country: 'France',

View File

@ -16,8 +16,8 @@ describe('valid position indexes decorator', () => {
myClassInstance.waypoints = [
{
position: 0,
lon: 48.8566,
lat: 2.3522,
lat: 48.8566,
lon: 2.3522,
locality: 'Paris',
postalCode: '75000',
country: 'France',
@ -40,8 +40,8 @@ describe('valid position indexes decorator', () => {
myClassInstance.waypoints = [
{
position: 1,
lon: 48.8566,
lat: 2.3522,
lat: 48.8566,
lon: 2.3522,
locality: 'Paris',
postalCode: '75000',
country: 'France',

View File

@ -3,8 +3,8 @@ import { WaypointDto } from '@modules/ad/interface/grpc-controllers/dtos/waypoin
describe('addresses position validator', () => {
const mockAddress1: WaypointDto = {
lon: 48.689445,
lat: 6.17651,
lat: 48.689445,
lon: 6.17651,
houseNumber: '5',
street: 'Avenue Foch',
locality: 'Nancy',
@ -12,8 +12,8 @@ describe('addresses position validator', () => {
country: 'France',
};
const mockAddress2: WaypointDto = {
lon: 48.8566,
lat: 2.3522,
lat: 48.8566,
lon: 2.3522,
locality: 'Paris',
postalCode: '75000',
country: 'France',