fix(tours): tidy the day times of a tour after review

The get_tour_plan description named the estimate of a tour "such a field"
right after the values of a recording, so it could be read as one of them.
It now follows the sentence on derived fields and says outright that it is
one of them, worked out from distance and heights or the pace of a run.

The arrow between a tour's start and end points from the start to the end
in a right-to-left language as well. A tour just added to a day, which
carries no tour_place_id until the next refresh, now says its overrun like
the row above it. A phone row of an import with a total the travellers
entered shows that one time, the estimate joining its words as on the
desktop. The German overrun line reads naturally without an item name.
This commit is contained in:
Maurice
2026-10-20 20:51:09 +02:00
parent 9765cf3fee
commit 7f14dde362
10 changed files with 109 additions and 19 deletions
@@ -1,5 +1,6 @@
// FE-COMP-PLACEFORM-001 to FE-COMP-PLACEFORM-036, FE-PLANNER-PLACEFORM-016 to FE-PLANNER-PLACEFORM-067, plus FE-PLANNER-PLACEFORM-068 to -124
// FE-COMP-PLACEFORM-001 to FE-COMP-PLACEFORM-036, FE-PLANNER-PLACEFORM-016 to FE-PLANNER-PLACEFORM-067, plus FE-PLANNER-PLACEFORM-068 to -125
import { render, screen, waitFor, fireEvent, within, act } from '../../../tests/helpers/render';
import type { TourListItem } from '@trek/shared';
import userEvent from '@testing-library/user-event';
import { http, HttpResponse } from 'msw';
import { server } from '../../../tests/helpers/msw/server';
@@ -878,6 +879,37 @@ describe('PlaceFormModal', () => {
expect(screen.getByDisplayValue('20:34')).toBeInTheDocument();
});
it('FE-PLANNER-PLACEFORM-125: a tour with a start and no end says below its times the end it works out to (TIME-02)', () => {
const place = buildPlace({ id: 7, name: 'Ridge', place_time: '09:00', end_time: null });
const assignment = buildAssignment({ id: 42, day_id: 3, place });
const tour: TourListItem = {
place_id: 7,
name: 'Ridge',
tour_type: 'hike',
distance: 8,
elevation_gain: 300,
elevation_loss: 300,
duration: 150,
planned_duration_minutes: null,
break_additional_minutes: 30,
difficulty: null,
wanderer_ref: null,
match_confidence: 1,
max_hiking_difficulty: 2,
planned: true,
caution: false,
};
const { unmount } = render(
<PlaceFormModal {...defaultProps} place={place} assignmentId={42} dayAssignments={[assignment]} tour={tour} />
);
expect(screen.getByTestId('tour-day-end-hint')).toHaveTextContent(
'Left empty, the end is worked out: 12:00, the start plus the tour time of 3 h.'
);
unmount();
render(<PlaceFormModal {...defaultProps} place={place} assignmentId={42} dayAssignments={[assignment]} />);
expect(screen.queryByTestId('tour-day-end-hint')).not.toBeInTheDocument();
});
it('FE-PLANNER-PLACEFORM-086: on a road trip the End says the drive leaves at it', () => {
const place = buildPlace({ name: 'Test', place_time: '09:00', end_time: '14:00' });
const assignment = buildAssignment({ id: 10, day_id: 5, place });