mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-04 18:04:18 +00:00
feat(tours): plan a trail run on forest tracks and natural paths
RUN-02. Trail running joins Running as a run profile, chosen on purpose in the planner and in the GPX import. It asks Valhalla's pedestrian costing for tracks wherever they serve (use_tracks 1) and admits mountain paths up to T2 (max_hiking_difficulty 2), never T3 and above, with ferries only where no way on land exists. Checked with trace_attributes against the public instance: above Freiburg Guenterstal up to the Schauinsland the route went from 82 % roads and 83 % paved (running) to 78 % forest tracks and 81 % compacted, gravel and dirt; Rathen to the Bastei took 28 % of T2 path that running leaves out; Heidelberg's old town stayed as it was. Leaning on footways (walkway_factor) was tried and left out, it moved runs onto paved footways. While a run is planned, a card says what it runs on: its surfaces, the hiking grades of its paths (sac_scale, T1 to T6, as mappers gave them) and its kinds of way, each as shares with lengths that point at their stretches on the map. A way without a grade or a surface is its own row, unknown and never easy, and an info dot says the grades say nothing about whether a way can be run. The head carries the unpaved share and the hardest graded path as badges. The line is matched on foot for this, so steps and mountain paths stay on it; a bike tour's is matched as before. Reading fails, goes offline or is retried as for a bike tour, and nothing of it changes the run. Pace and time are RUN-01's: the running time stays the distance at the runner's pace, with climbs, descents and difficulty left out, whatever the profile. A profile change plans the route again and keeps the pace; a failed trail route keeps the last route and holds Save back. The card's building blocks moved out of the bike card into RouteWaySections, so both cards share one set of rows, bars and status lines. The run_profile column already allowed trail (RUN-01), so no migration. GPX export names a trail run trail_running, list_tours describes the profile as a routing preference, never a statement that a way can be run.
This commit is contained in:
@@ -4,7 +4,7 @@ import { describe, expect, it, vi } from 'vitest';
|
||||
import { RunFields, RunProfileField } from './RunFields';
|
||||
import { runPaceInvalid } from './runPace';
|
||||
|
||||
// FE-TOUR-RUN-FIELDS-001 to FE-TOUR-RUN-FIELDS-006
|
||||
// FE-TOUR-RUN-FIELDS-001 to FE-TOUR-RUN-FIELDS-008
|
||||
|
||||
type Planner = ComponentProps<typeof RunFields>['planner'];
|
||||
|
||||
@@ -14,14 +14,16 @@ const analysis = { distanceKm: 8 } as Planner['routeAnalysis'];
|
||||
function Stateful({
|
||||
initial = null,
|
||||
distance = analysis,
|
||||
profile = 'running',
|
||||
}: {
|
||||
initial?: number | null;
|
||||
distance?: Planner['routeAnalysis'];
|
||||
profile?: Planner['runProfile'];
|
||||
}) {
|
||||
const [pace, setPace] = useState<number | null>(initial);
|
||||
const invalid = runPaceInvalid(pace);
|
||||
const planner: Planner = {
|
||||
runProfile: 'running',
|
||||
runProfile: profile,
|
||||
setRunProfile: vi.fn(),
|
||||
runPace: { paceSecondsPerKm: pace, setPace, load: setPace },
|
||||
runPaceMissing: pace === null,
|
||||
@@ -127,4 +129,23 @@ describe('RunFields (RUN-01)', () => {
|
||||
expect(paceField()).toHaveValue('5:00');
|
||||
expect(screen.queryByTestId('tour-run-time-sum')).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-TOUR-RUN-FIELDS-007: offers trail running beside running, with the ways it asks for (RUN-02)', () => {
|
||||
const onChange = vi.fn();
|
||||
render(<RunProfileField value="trail" onChange={onChange} />);
|
||||
expect(screen.getByRole('button', { name: 'tours.run.profile.trail' })).toHaveAttribute('aria-pressed', 'true');
|
||||
expect(screen.getByText('tours.run.profileHint.trail')).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'tours.run.profile.running' }));
|
||||
expect(onChange).toHaveBeenCalledWith('running');
|
||||
});
|
||||
|
||||
it('FE-TOUR-RUN-FIELDS-008: a trail run is timed as any run, distance times pace, nothing added for the terrain (RUN-02)', () => {
|
||||
render(<Stateful initial={450} profile="trail" />);
|
||||
const sum = screen.getByTestId('tour-run-time-sum');
|
||||
expect(sum).toHaveTextContent('7:30 /km');
|
||||
expect(sum).toHaveTextContent('1 h');
|
||||
expect(screen.getByRole('button', { name: 'tours.run.paceInfoLabel' })).toHaveAccessibleDescription(
|
||||
'tours.run.paceInfo'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
RUN_PROFILES,
|
||||
type RunProfile,
|
||||
} from '@trek/shared';
|
||||
import { Activity, Clock, Gauge, Info, Ruler, type LucideIcon } from 'lucide-react';
|
||||
import { Clock, Gauge, Info, Ruler } from 'lucide-react';
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from '../../../i18n';
|
||||
import { formatDistance } from '../../../utils/units';
|
||||
@@ -15,13 +15,12 @@ import type { TourPlannerController } from '../planner/useTourPlanner';
|
||||
import { InfoDot, TourNotice } from '../tourParts';
|
||||
import { formatPlannedTourDuration } from '../tourPresentation';
|
||||
import { formatRunPace, parseRunPace, RUN_PACE_INPUT_MAX_LENGTH, runPaceInvalid } from './runPace';
|
||||
|
||||
const PROFILE_ICON: Record<RunProfile, LucideIcon> = { running: Activity };
|
||||
import { RUN_PROFILE_ICON } from './runProfileIcon';
|
||||
|
||||
/**
|
||||
* RUN-01: what a run is planned as, chosen on purpose like a bike tour's
|
||||
* profile, with a line on the ways it asks the router for. The planner and
|
||||
* the GPX import share it.
|
||||
* RUN-01, RUN-02: what a run is planned as, running or trail running, chosen
|
||||
* on purpose like a bike tour's profile, with a line on the ways it asks the
|
||||
* router for. The planner and the GPX import share it.
|
||||
*/
|
||||
export function RunProfileField({ value, onChange }: { value: RunProfile; onChange: (profile: RunProfile) => void }) {
|
||||
const { t } = useTranslation();
|
||||
@@ -34,7 +33,7 @@ export function RunProfileField({ value, onChange }: { value: RunProfile; onChan
|
||||
label={t('tours.run.profile')}
|
||||
fill
|
||||
options={RUN_PROFILES.map((profile) => {
|
||||
const Icon = PROFILE_ICON[profile];
|
||||
const Icon = RUN_PROFILE_ICON[profile];
|
||||
return {
|
||||
value: profile,
|
||||
label: t(`tours.run.profile.${profile}`),
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import type { TourListItem } from '@trek/shared';
|
||||
import { Activity, Gauge } from 'lucide-react';
|
||||
import { Gauge } from 'lucide-react';
|
||||
import { useTranslation } from '../../../i18n';
|
||||
import { fs } from '../../shared/DialogShell';
|
||||
import { Tooltip } from '../../shared/Tooltip';
|
||||
import { runPaceText } from './runPaceText';
|
||||
import { RUN_PROFILE_ICON } from './runProfileIcon';
|
||||
|
||||
/**
|
||||
* RUN-01: a run's profile and planned pace as pills of a tour's head, beside
|
||||
* RUN-01, RUN-02: a run's profile and planned pace as pills of a tour's head, beside
|
||||
* its type. The pace's tooltip says the running time is that pace over the
|
||||
* distance and nothing more; a run without a pace shows no pace pill.
|
||||
*/
|
||||
@@ -20,11 +21,12 @@ export function RunHeadPills({
|
||||
const { t } = useTranslation();
|
||||
if (tour.tour_type !== 'run') return null;
|
||||
const pace = runPaceText(tour, t);
|
||||
const ProfileIcon = RUN_PROFILE_ICON[tour.run_profile ?? 'running'];
|
||||
return (
|
||||
<>
|
||||
{tour.run_profile && (
|
||||
<span data-testid="tour-detail-run-profile" className={className} style={fs(10.5)}>
|
||||
<Activity size={11} strokeWidth={2} className="flex-none text-content-faint" aria-hidden="true" />
|
||||
<ProfileIcon size={11} strokeWidth={2} className="flex-none text-content-faint" aria-hidden="true" />
|
||||
{t(`tours.run.profile.${tour.run_profile}`)}
|
||||
</span>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { fireEvent, render, screen, within } from '../../../../tests/helpers/render';
|
||||
import { useTourRouteHighlightStore } from '../../../store/tourRouteHighlightStore';
|
||||
import type { RouteWays } from '../bike/routeWays';
|
||||
import type { RouteWaysState } from '../bike/useRouteWays';
|
||||
import { hardestSac, RunWaysCard } from './RunWaysCard';
|
||||
|
||||
const hook = vi.hoisted(() => ({ state: null as unknown, retry: vi.fn(), input: null as unknown }));
|
||||
vi.mock('../bike/useRouteWays', () => ({
|
||||
useRouteWays: (input: unknown) => {
|
||||
hook.input = input;
|
||||
return { ...(hook.state as object), retry: hook.retry };
|
||||
},
|
||||
}));
|
||||
|
||||
// FE-TOUR-RUNWAYS-001 to FE-TOUR-RUNWAYS-007
|
||||
|
||||
type Planner = Parameters<typeof RunWaysCard>[0]['planner'];
|
||||
|
||||
const LINE: [number, number][] = [
|
||||
[47.0, 11.0],
|
||||
[47.001, 11.0],
|
||||
[47.002, 11.0],
|
||||
[47.003, 11.0],
|
||||
];
|
||||
const WAYS: RouteWays = {
|
||||
line: LINE,
|
||||
edges: [
|
||||
{ from: 0, to: 1, lengthM: 600, surface: 'paved', way: 'road', sac: 'none', wayId: 1 },
|
||||
{ from: 1, to: 2, lengthM: 300, surface: 'gravel', way: 'track', sac: 't1', wayId: 2 },
|
||||
{ from: 2, to: 3, lengthM: 100, surface: 'ground', way: 'path', sac: 't2', wayId: 3 },
|
||||
],
|
||||
};
|
||||
|
||||
function planner(overrides: Partial<Planner> = {}): Planner {
|
||||
return {
|
||||
tripId: 4,
|
||||
mode: { type: 'new-draft' },
|
||||
isRun: true,
|
||||
route: LINE,
|
||||
routeCurrent: true,
|
||||
...overrides,
|
||||
} as Planner;
|
||||
}
|
||||
|
||||
function show(state: Partial<RouteWaysState>, overrides: Partial<Planner> = {}) {
|
||||
hook.state = { status: 'ready', ways: WAYS, grades: null, ...state };
|
||||
return render(<RunWaysCard planner={planner(overrides)} />);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
localStorage.clear();
|
||||
useTourRouteHighlightStore.getState().clear();
|
||||
});
|
||||
afterEach(() => vi.clearAllMocks());
|
||||
|
||||
describe('RunWaysCard (RUN-02)', () => {
|
||||
it('FE-TOUR-RUNWAYS-001: shows the surfaces, the hiking grades and the kinds of way, the ungraded named as unknown', () => {
|
||||
show({});
|
||||
expect(within(screen.getByTestId('route-ways-row-surface-paved')).getByText('60 %')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('route-ways-row-surface-gravel')).toHaveTextContent('300 m');
|
||||
expect(screen.getByTestId('route-ways-row-grade-t1')).toHaveTextContent('T1');
|
||||
expect(screen.getByTestId('route-ways-row-grade-t2')).toHaveTextContent('10 %');
|
||||
expect(screen.getByTestId('route-ways-row-grade-none')).toHaveTextContent('No grade in the data');
|
||||
expect(screen.getByTestId('route-ways-row-way-track')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: 'About the path difficulty' })).toHaveAccessibleDescription(
|
||||
/unknown, not easy/
|
||||
);
|
||||
});
|
||||
|
||||
it('FE-TOUR-RUNWAYS-002: the head says how much is unpaved and the hardest graded path, in words for assistive tech', () => {
|
||||
show({});
|
||||
expect(screen.getByText('40 % unpaved')).toBeInTheDocument();
|
||||
const hardest = screen.getByTestId('run-ways-hardest');
|
||||
expect(hardest).toHaveTextContent('T2');
|
||||
expect(hardest).toHaveTextContent(/Hardest graded path: T2/);
|
||||
});
|
||||
|
||||
it('FE-TOUR-RUNWAYS-003: a grade row points at its stretches on the map in the grade colour, and lets go', () => {
|
||||
show({});
|
||||
const row = screen.getByTestId('route-ways-row-grade-t2');
|
||||
fireEvent.click(row);
|
||||
expect(useTourRouteHighlightStore.getState().highlight).toEqual({
|
||||
id: 'grade-t2',
|
||||
lines: [LINE.slice(2, 4)],
|
||||
paint: 's1',
|
||||
});
|
||||
fireEvent.click(row);
|
||||
expect(useTourRouteHighlightStore.getState().highlight).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-TOUR-RUNWAYS-004: a route all paved and ungraded shows no head badges, and its grades as unknown', () => {
|
||||
const paved: RouteWays = { line: LINE, edges: [WAYS.edges[0]] };
|
||||
show({ ways: paved });
|
||||
expect(screen.queryByText(/unpaved/)).toBeNull();
|
||||
expect(screen.queryByTestId('run-ways-hardest')).toBeNull();
|
||||
expect(screen.getByTestId('route-ways-row-grade-none')).toHaveTextContent('100 %');
|
||||
});
|
||||
|
||||
it('FE-TOUR-RUNWAYS-005: says when it is still asking, offline, or failed with a way to ask again', () => {
|
||||
const loading = show({ status: 'loading', ways: null });
|
||||
expect(screen.getByTestId('run-ways-card')).toHaveTextContent(/./);
|
||||
loading.unmount();
|
||||
const offline = show({ status: 'offline', ways: null });
|
||||
expect(screen.queryByRole('button', { name: /try again/i })).toBeNull();
|
||||
offline.unmount();
|
||||
show({ status: 'failed', ways: null });
|
||||
fireEvent.click(screen.getByRole('button', { name: /try again/i }));
|
||||
expect(hook.retry).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('FE-TOUR-RUNWAYS-006: matched on foot without trail grades, and only for a run being edited with its route as planned now', () => {
|
||||
const run = show({});
|
||||
expect(hook.input).toMatchObject({
|
||||
tripId: 4,
|
||||
active: true,
|
||||
route: LINE,
|
||||
matchAs: 'pedestrian',
|
||||
withGrades: false,
|
||||
});
|
||||
run.unmount();
|
||||
const idle = show({ status: 'idle', ways: null });
|
||||
expect(screen.queryByTestId('run-ways-card')).toBeNull();
|
||||
idle.unmount();
|
||||
const bike = show({}, { isRun: false });
|
||||
expect(screen.queryByTestId('run-ways-card')).toBeNull();
|
||||
bike.unmount();
|
||||
show({}, { routeCurrent: false, mode: { type: 'view-gpx' } as Planner['mode'] });
|
||||
expect(screen.queryByTestId('run-ways-card')).toBeNull();
|
||||
expect(hook.input).toMatchObject({ active: false, route: null });
|
||||
});
|
||||
|
||||
it('FE-TOUR-RUNWAYS-007: the hardest graded step along the route, a stretch of no length left out', () => {
|
||||
expect(hardestSac(WAYS)).toBe('t2');
|
||||
expect(hardestSac({ line: LINE, edges: [{ ...WAYS.edges[2], sac: 't5', lengthM: 0 }, WAYS.edges[1]] })).toBe('t1');
|
||||
expect(hardestSac({ line: LINE, edges: [WAYS.edges[0]] })).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,127 @@
|
||||
import { Layers, Mountain } from 'lucide-react';
|
||||
import { useMemo } from 'react';
|
||||
import { useTranslation } from '../../../i18n';
|
||||
import { SoftPill } from '../../Planner/planParts';
|
||||
import { Tooltip } from '../../shared/Tooltip';
|
||||
import { sacPaintKey } from '../bike/bikePaint';
|
||||
import {
|
||||
percent,
|
||||
RouteWaysProgress,
|
||||
RouteWaysSource,
|
||||
ShareBar,
|
||||
ShareList,
|
||||
SurfaceSection,
|
||||
WaySection,
|
||||
WaysSection,
|
||||
} from '../bike/RouteWaySections';
|
||||
import { sharesBy, unpavedShareOf, type RouteWayEdge, type RouteWays, type SacClass } from '../bike/routeWays';
|
||||
import { useRouteWays } from '../bike/useRouteWays';
|
||||
import type { TourPlannerController } from '../planner/useTourPlanner';
|
||||
import { RailCard } from '../tourParts';
|
||||
|
||||
type GradedClass = Exclude<SacClass, 'none'>;
|
||||
|
||||
const sacOf = (edge: RouteWayEdge) => edge.sac;
|
||||
|
||||
/** The steps from easy to hard, so the hardest one along the route is the last one found. */
|
||||
const SAC_STEPS: readonly GradedClass[] = ['t1', 't2', 't3', 't4', 't5', 't6'];
|
||||
|
||||
/** A hiking grade in the words the hiking limit uses for it, a way without one as unknown. */
|
||||
function useSacLabel() {
|
||||
const { t } = useTranslation();
|
||||
return (key: SacClass) => (key === 'none' ? t('tours.bike.trail.none') : t(`tours.planner.difficulty.${key}`));
|
||||
}
|
||||
|
||||
/** The hardest graded step along the route, or null when no way on it carries a grade. */
|
||||
export function hardestSac(ways: RouteWays): GradedClass | null {
|
||||
const found = new Set(ways.edges.filter((edge) => edge.lengthM > 0).map((edge) => edge.sac));
|
||||
return [...SAC_STEPS].reverse().find((step) => found.has(step)) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* RUN-02: the hiking grades along a run (sac_scale) as OpenStreetMap mappers
|
||||
* gave them, by share, each pointing at its stretches on the map. A way
|
||||
* without a grade is its own row: unknown, never easy. What the grades are
|
||||
* and are not sits behind the info dot, not in a line of its own.
|
||||
*/
|
||||
function PathGradeSection({ ways }: { ways: RouteWays }) {
|
||||
const { t } = useTranslation();
|
||||
const labelOf = useSacLabel();
|
||||
const rows = useMemo(() => sharesBy<SacClass>(ways, sacOf), [ways]);
|
||||
return (
|
||||
<WaysSection
|
||||
label={t('tours.run.ways.grade')}
|
||||
info={{ label: t('tours.run.ways.gradeInfoLabel'), description: t('tours.run.ways.gradeInfo') }}
|
||||
>
|
||||
<ShareBar rows={rows} paintOf={sacPaintKey} />
|
||||
<ShareList ways={ways} rows={rows} idPrefix="grade" classOf={sacOf} labelOf={labelOf} paintOf={sacPaintKey} />
|
||||
</WaysSection>
|
||||
);
|
||||
}
|
||||
|
||||
/** The card's head: how much of the run is known to be unpaved, and the hardest graded path on it. */
|
||||
function RunWaysBadges({ ways }: { ways: RouteWays | null }) {
|
||||
const { t } = useTranslation();
|
||||
const labelOf = useSacLabel();
|
||||
const unpaved = useMemo(() => (ways ? unpavedShareOf(ways) : null), [ways]);
|
||||
const hardest = useMemo(() => (ways ? hardestSac(ways) : null), [ways]);
|
||||
if (unpaved === null && hardest === null) return null;
|
||||
const hardestText = hardest ? t('tours.run.ways.gradeTop', { grade: labelOf(hardest) }) : '';
|
||||
return (
|
||||
<span className="flex flex-none items-center gap-1">
|
||||
{unpaved !== null && <SoftPill>{t('tours.bike.ways.unpavedBadge', { share: percent(unpaved) })}</SoftPill>}
|
||||
{hardest && (
|
||||
<Tooltip label={hardestText}>
|
||||
<span data-testid="run-ways-hardest" className="inline-flex">
|
||||
<SoftPill icon={<Mountain size={10} strokeWidth={2.2} aria-hidden="true" />}>
|
||||
<span aria-hidden="true">{hardest.toUpperCase()}</span>
|
||||
<span className="sr-only">{hardestText}</span>
|
||||
</SoftPill>
|
||||
</span>
|
||||
</Tooltip>
|
||||
)}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
type RunWaysPlanner = Pick<TourPlannerController, 'tripId' | 'mode' | 'isRun' | 'route' | 'routeCurrent'>;
|
||||
|
||||
/**
|
||||
* RUN-02: what the run being planned runs on: its surfaces, the hiking grades
|
||||
* of its paths and its kinds of way, read off the router's description of the
|
||||
* route matched on foot. Where the data says nothing the card says unknown,
|
||||
* and nothing here grades the run, changes its time or changes the tour.
|
||||
*/
|
||||
export function RunWaysCard({ planner }: { planner: RunWaysPlanner }) {
|
||||
const { t } = useTranslation();
|
||||
const editing = planner.mode.type === 'new-draft' || planner.mode.type === 'edit-saved';
|
||||
const state = useRouteWays({
|
||||
tripId: planner.tripId,
|
||||
active: planner.isRun && editing,
|
||||
route: planner.routeCurrent ? planner.route : null,
|
||||
matchAs: 'pedestrian',
|
||||
withGrades: false,
|
||||
});
|
||||
const { ways } = state;
|
||||
if (!planner.isRun || !editing || state.status === 'idle') return null;
|
||||
return (
|
||||
<RailCard
|
||||
icon={<Layers size={14} strokeWidth={2} />}
|
||||
title={t('tours.bike.ways.title')}
|
||||
foldId="run-ways"
|
||||
aside={<RunWaysBadges ways={ways} />}
|
||||
>
|
||||
<div data-testid="run-ways-card" className="flex min-w-0 flex-col gap-3">
|
||||
<RouteWaysProgress state={state} />
|
||||
{ways && (
|
||||
<>
|
||||
<SurfaceSection ways={ways} />
|
||||
<PathGradeSection ways={ways} />
|
||||
<WaySection ways={ways} />
|
||||
<RouteWaysSource />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</RailCard>
|
||||
);
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import { TourGradeTile } from '../tourParts';
|
||||
import { RunHeadPills } from './RunHeadPills';
|
||||
import { runPaceText } from './runPaceText';
|
||||
|
||||
// FE-TOUR-RUN-MARK-001 to FE-TOUR-RUN-MARK-006
|
||||
// FE-TOUR-RUN-MARK-001 to FE-TOUR-RUN-MARK-007
|
||||
|
||||
const run: TourListItem = {
|
||||
place_id: 7,
|
||||
@@ -87,4 +87,13 @@ describe('a run wherever a tour shows (RUN-01)', () => {
|
||||
rerender(<RunHeadPills tour={{ ...run, tour_type: 'hike', run_profile: null }} className="head-pill" />);
|
||||
expect(screen.queryByTestId('tour-detail-run-profile')).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-TOUR-RUN-MARK-007: a trail run goes by its own profile, and its time and pace read as any run's (RUN-02)', () => {
|
||||
const trail = { ...run, run_profile: 'trail' as const, run_pace_seconds_per_km: 450, duration: 60 };
|
||||
render(<RunHeadPills tour={trail} className="head-pill" />);
|
||||
expect(screen.getByTestId('tour-detail-run-profile')).toHaveTextContent('Trail running');
|
||||
expect(screen.getByTestId('tour-detail-run-pace')).toHaveTextContent('7:30 min/km');
|
||||
render(<TourDayRowFacts tour={trail} />);
|
||||
expect(screen.getByTestId('plan-tour-run-pace')).toHaveAccessibleName('Planned pace: 7:30 min/km');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { RunProfile } from '@trek/shared';
|
||||
import { Activity, Trees, type LucideIcon } from 'lucide-react';
|
||||
|
||||
/** RUN-01, RUN-02: the icon a run profile goes by, in its picker and on a run's head. */
|
||||
export const RUN_PROFILE_ICON: Record<RunProfile, LucideIcon> = { running: Activity, trail: Trees };
|
||||
Reference in New Issue
Block a user