fix(tours): translate the ferrata badge everywhere, count the tile cache writes as standalone, settle the new test warnings

This commit is contained in:
Maurice
2026-10-14 20:34:20 +02:00
parent 62b50e3f9b
commit d87e276831
18 changed files with 45 additions and 34 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
"@typescript-eslint/no-non-null-assertion": 404,
"@typescript-eslint/no-misused-promises": 876,
"no-console": 88,
"complexity": 231,
"complexity": 230,
"@typescript-eslint/no-explicit-any": 148,
"trek/no-swallowed-catch": 133,
"max-params": 35,
@@ -31,8 +31,10 @@ const routed = {
}
const enriched = [[48, 11, 500], [48.01, 11.02, 550]] as [number, number, number][]
// With the heights in, the walking time is the hiking rule over the enriched line, not the router's.
const enrichedAnalysis = analyzeRouteGeometry(JSON.stringify(enriched))!
const enrichedWalkingSeconds = hikingTimeMinutes(enrichedAnalysis.distanceKm, enrichedAnalysis.gain!, enrichedAnalysis.loss!) * 60
const enrichedAnalysis = analyzeRouteGeometry(JSON.stringify(enriched))
if (!enrichedAnalysis) throw new Error('the enriched line has no analysis')
const enrichedWalkingSeconds =
hikingTimeMinutes(enrichedAnalysis.distanceKm, enrichedAnalysis.gain ?? 0, enrichedAnalysis.loss ?? 0) * 60
const savedTour = {
place_id: 42,
name: 'Saved ridge',
@@ -48,12 +48,18 @@ describe('usePlacedPointHint', () => {
const { result, place } = setup();
place([A, B]);
act(() => result.current.hold(true));
act(() => vi.advanceTimersByTime(PLACED_HINT_MS * 2));
act(() => {
vi.advanceTimersByTime(PLACED_HINT_MS * 2);
});
expect(result.current.shown).toBe(true);
act(() => result.current.hold(false));
act(() => vi.advanceTimersByTime(PLACED_HINT_MS - 1));
act(() => {
vi.advanceTimersByTime(PLACED_HINT_MS - 1);
});
expect(result.current.shown).toBe(true);
act(() => vi.advanceTimersByTime(1));
act(() => {
vi.advanceTimersByTime(1);
});
expect(result.current.shown).toBe(false);
});