Profiles in a dialog, the chip in the map's bottom-left corner picks one (the Design canvas' Vehicle): a car gains fuel, Euro class, stickers and vignettes / toll units with dates; drive mode's Menu steps through them. Speed limits by country for cars and over 3.5 t (public/js/speed_limits.js, sources in it): the route's roads (km, road class, country), the limit shown the lower of the sign and the profile's; the Route panel's countries with their limits and how the motorways are paid; past a border a card in drive mode (GridBorder). The itinerary in the Route panel (Itinerary): the trip's name, leave time, days start; per stop a night, stay and note, planned times, day headers; another screen's change shown where it happened with Undo
This commit is contained in:
1 parent
a6158f4083
commit
5e31dfaba9
15 files changed
+733
-169
No files matched your search
@@ -26,6 +26,23 @@ class TripTest < Minitest::Test
|
||||
end
|
||||
end
|
||||
|
||||
def test_the_itinerary_keeps_nights_stays_notes_and_the_start_without_routing_again
|
||||
Dir.mktmpdir do |dir|
|
||||
store = Maptool::TripStore.new(File.join(dir, "trip.json"))
|
||||
calls = 0
|
||||
router = ->(*) { calls += 1; { type: "Feature" } }
|
||||
points = [{ lngLat: [17.1, 48.1] }, { lngLat: [17.2, 48.2] }]
|
||||
store.update(points: points, vehicle: nil, avoid: {}, editing: nil, &router)
|
||||
points[1] = { lngLat: [17.2, 48.2], night: true, stay: "90", note: " call ahead " }
|
||||
trip = store.update(points: points, vehicle: nil, avoid: {}, editing: nil, name: "Alps", start: "2026-12-12T08:00", day_start: "09:30", &router)
|
||||
assert_equal 1, calls # an itinerary change isn't a route change
|
||||
assert_equal({ lngLat: [17.2, 48.2], name: nil, nav: false, passed: false, night: true, stay: 90, note: "call ahead" }.compact, trip[:points][1])
|
||||
assert_equal ["Alps", "2026-12-12T08:00", "09:30"], trip.values_at(:name, :start, :day_start)
|
||||
assert_raises(ArgumentError) { store.update(points: [{ lngLat: [1, 2], stay: "-5" }], vehicle: nil, avoid: {}, editing: nil, &router) }
|
||||
assert_raises(ArgumentError) { store.update(points: points, vehicle: nil, avoid: {}, editing: nil, start: "tomorrow", &router) }
|
||||
end
|
||||
end
|
||||
|
||||
# Off the route while driving for 3 fixes: routed again from the position
|
||||
# to the points not reached yet (the first via passed: dropped).
|
||||
def test_following_reroutes_from_the_position_off_the_route
|
||||
|
||||
Reference in new issue
Block a user