Rename schedule fixtures for better readability of tests

This commit is contained in:
Romain Thouvenin 2024-04-05 11:43:30 +02:00
parent 0dc01da2b0
commit 173e5ebba5
1 changed files with 29 additions and 29 deletions

View File

@ -37,7 +37,7 @@ const waypointsSet2: PointProps[] = [
}, },
]; ];
const schedule1: ScheduleItemProps[] = [ const mondayAt7: ScheduleItemProps[] = [
{ {
day: 1, day: 1,
time: '07:00', time: '07:00',
@ -45,7 +45,7 @@ const schedule1: ScheduleItemProps[] = [
}, },
]; ];
const schedule2: ScheduleItemProps[] = [ const mondayAt710: ScheduleItemProps[] = [
{ {
day: 1, day: 1,
time: '07:10', time: '07:10',
@ -53,7 +53,7 @@ const schedule2: ScheduleItemProps[] = [
}, },
]; ];
const schedule3: ScheduleItemProps[] = [ const weekdayMornings: ScheduleItemProps[] = [
{ {
day: 1, day: 1,
time: '06:30', time: '06:30',
@ -81,7 +81,7 @@ const schedule3: ScheduleItemProps[] = [
}, },
]; ];
const schedule4: ScheduleItemProps[] = [ const schooldayMornings: ScheduleItemProps[] = [
{ {
day: 1, day: 1,
time: '06:50', time: '06:50',
@ -104,7 +104,7 @@ const schedule4: ScheduleItemProps[] = [
}, },
]; ];
const schedule5: ScheduleItemProps[] = [ const saturdayNightAndMondayMorning: ScheduleItemProps[] = [
{ {
day: 0, day: 0,
time: '00:02', time: '00:02',
@ -117,7 +117,7 @@ const schedule5: ScheduleItemProps[] = [
}, },
]; ];
const schedule6: ScheduleItemProps[] = [ const mondayAndSaturdayNights: ScheduleItemProps[] = [
{ {
day: 1, day: 1,
time: '23:10', time: '23:10',
@ -130,7 +130,7 @@ const schedule6: ScheduleItemProps[] = [
}, },
]; ];
const schedule7: ScheduleItemProps[] = [ const thursdayEvening: ScheduleItemProps[] = [
{ {
day: 4, day: 4,
time: '19:00', time: '19:00',
@ -266,8 +266,8 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule1, driverSchedule: mondayAt7,
passengerSchedule: schedule2, passengerSchedule: mondayAt710,
spacetimeDetourRatio, spacetimeDetourRatio,
}); });
expect(candidateEntity.id.length).toBe(36); expect(candidateEntity.id.length).toBe(36);
@ -286,8 +286,8 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule1, driverSchedule: mondayAt7,
passengerSchedule: schedule2, passengerSchedule: mondayAt710,
spacetimeDetourRatio, spacetimeDetourRatio,
}).setCarpoolPath(carpoolPath1); }).setCarpoolPath(carpoolPath1);
expect(candidateEntity.getProps().carpoolPath).toHaveLength(2); expect(candidateEntity.getProps().carpoolPath).toHaveLength(2);
@ -306,8 +306,8 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule1, driverSchedule: mondayAt7,
passengerSchedule: schedule2, passengerSchedule: mondayAt710,
spacetimeDetourRatio, spacetimeDetourRatio,
}).setMetrics(352688, 14587); }).setMetrics(352688, 14587);
expect(candidateEntity.getProps().distance).toBe(352688); expect(candidateEntity.getProps().distance).toBe(352688);
@ -328,8 +328,8 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule1, driverSchedule: mondayAt7,
passengerSchedule: schedule2, passengerSchedule: mondayAt710,
spacetimeDetourRatio, spacetimeDetourRatio,
}).setMetrics(458690, 13980); }).setMetrics(458690, 13980);
expect(candidateEntity.isDetourValid()).toBeFalsy(); expect(candidateEntity.isDetourValid()).toBeFalsy();
@ -347,8 +347,8 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule1, driverSchedule: mondayAt7,
passengerSchedule: schedule2, passengerSchedule: mondayAt710,
spacetimeDetourRatio, spacetimeDetourRatio,
}).setMetrics(352368, 18314); }).setMetrics(352368, 18314);
expect(candidateEntity.isDetourValid()).toBeFalsy(); expect(candidateEntity.isDetourValid()).toBeFalsy();
@ -369,8 +369,8 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule1, driverSchedule: mondayAt7,
passengerSchedule: schedule2, passengerSchedule: mondayAt710,
spacetimeDetourRatio, spacetimeDetourRatio,
}) })
.setCarpoolPath(carpoolPath2) .setCarpoolPath(carpoolPath2)
@ -392,7 +392,7 @@ describe('Candidate entity', () => {
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: undefined, driverSchedule: undefined,
passengerSchedule: schedule2, passengerSchedule: mondayAt710,
spacetimeDetourRatio, spacetimeDetourRatio,
}) })
.setCarpoolPath(carpoolPath2) .setCarpoolPath(carpoolPath2)
@ -424,7 +424,7 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule1, driverSchedule: mondayAt7,
passengerSchedule: undefined, passengerSchedule: undefined,
spacetimeDetourRatio, spacetimeDetourRatio,
}) })
@ -480,8 +480,8 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule3, driverSchedule: weekdayMornings,
passengerSchedule: schedule4, passengerSchedule: schooldayMornings,
spacetimeDetourRatio, spacetimeDetourRatio,
}) })
.setCarpoolPath(carpoolPath2) .setCarpoolPath(carpoolPath2)
@ -517,8 +517,8 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule5, driverSchedule: saturdayNightAndMondayMorning,
passengerSchedule: schedule6, passengerSchedule: mondayAndSaturdayNights,
spacetimeDetourRatio, spacetimeDetourRatio,
}) })
.setCarpoolPath(carpoolPath2) .setCarpoolPath(carpoolPath2)
@ -564,8 +564,8 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule1, driverSchedule: mondayAt7,
passengerSchedule: schedule7, passengerSchedule: thursdayEvening,
spacetimeDetourRatio, spacetimeDetourRatio,
}) })
.setCarpoolPath(carpoolPath2) .setCarpoolPath(carpoolPath2)
@ -588,8 +588,8 @@ describe('Candidate entity', () => {
passengerWaypoints: waypointsSet2, passengerWaypoints: waypointsSet2,
driverDistance: 350145, driverDistance: 350145,
driverDuration: 13548, driverDuration: 13548,
driverSchedule: schedule1, driverSchedule: mondayAt7,
passengerSchedule: schedule7, passengerSchedule: thursdayEvening,
spacetimeDetourRatio, spacetimeDetourRatio,
}) })
.setCarpoolPath(carpoolPath2) .setCarpoolPath(carpoolPath2)