mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 01:28:55 +00:00
fix(roadtrip): the drive between two days can take another way too
The drive from where one day ended to where the next begins was the one stretch of a connected road trip that offered no other ways. The band above a card's first stop had no button on the desk, and the phone did not show that drive at all. A via behind a day's last stop, where the map already files a point dropped on that drive, was deleted when the day was reordered under Days, and was left on no stop when that last stop was removed or dragged up the day. Switching the avoided road classes or the day's profile kept the old road and minutes on it until a reload. The drive in now opens the same picker as any leg, on the desk band and on a new row at the head of the phone's chain that names where it leaves. A choice is proven with the seam's own router and written behind the last stop of the day before, also when a day with a single stop lies between. The rule for that via lives once in shared (carriedSeam): it stays with the last stop while that stop stays last, and is read like any other once it is not, for the planner's drags and removals as for the server's sorts and seated nights. The cached answer for a seam now records its mode and avoided classes, so changing either asks for it again.
This commit is contained in:
@@ -573,6 +573,24 @@ describe('updateTime', () => {
|
||||
expect(update.vias?.vias.map(v => [v.id, v.after_order_index])).toEqual([[afterB, 2], [intoTomorrow, 3]]);
|
||||
});
|
||||
|
||||
it('ASG-SVC-042: a sort that moves the last stop up the day takes the drive behind it along, never leaving it on no stop', () => {
|
||||
// The rule the planner applies too (carriedSeam): a via behind the last stop stays
|
||||
// there only while that stop is last. Once another stop is, the via follows its stop
|
||||
// like any other, and nothing is left on an index behind the day's end.
|
||||
const { day, ids: [a, b, c] } = dayOf([['09:00', 0], ['12:00', 1], ['18:00', 2]]);
|
||||
const afterA = addVia(day.id, 0);
|
||||
const intoTomorrow = addVia(day.id, 2);
|
||||
|
||||
const update = svc.updateTime(c, '08:00', null);
|
||||
|
||||
expect(dayOrder(day.id)).toEqual([c, a, b]);
|
||||
expect(viaAnchors(day.id)).toEqual([
|
||||
{ id: afterA, after_order_index: 1, sequence: 0 },
|
||||
{ id: intoTomorrow, after_order_index: 0, sequence: 0 },
|
||||
]);
|
||||
expect(update.vias?.dayId).toBe(day.id);
|
||||
});
|
||||
|
||||
it('ASG-SVC-040: an End saved with the start as it stood leaves a day dragged out of time order alone', () => {
|
||||
// B belongs first by time, and the traveller put it second on purpose.
|
||||
const { day, ids: [a, b, c] } = dayOf([['14:00', 0], ['10:00', 1], ['16:00', 2]]);
|
||||
|
||||
Reference in New Issue
Block a user