mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 23:46:35 +00:00
31859651d7
Every help screen checked against the v5 redesign. Tours is documented for the first time, as a screen of its own with twelve screens under it, and notifications get help of their own. All pictures are taken again on a realistic demo trip, with short loops where a still cannot show the motion. The English is plain and every language is written naturally rather than word for word. The switcher shows two levels at most, a screen's overview lists its sub-screens as cards above its guides, each wiki page is linked once, and the help sidebar is wider. Fixes found along the way: Save to Collection keeps a tour's route, a track dropped on the places column opens the Tours import, tour Share on desktop, the unsaved tour draft lives on the account, a route click no longer adds an end point, Trip places leaves the trip's tours out, Escape closes a stage's day menu, confirms before destructive deletes, DWD warnings sharing one id kept apart, a booking's date moves with it, and smaller fixes across notifications, bookings, the day plan, stays, Atlas, Collections, Vacay and the admin screens.
65 lines
2.6 KiB
TypeScript
65 lines
2.6 KiB
TypeScript
import { vi } from 'vitest';
|
|
|
|
/**
|
|
* The trip store actions the planner hook snapshots on mount, each replaced by a
|
|
* spy. A suite seeds them into the store so it can assert which write the hook
|
|
* reached for without running the real slices.
|
|
*/
|
|
export interface PlannerActions {
|
|
loadTrip: ReturnType<typeof vi.fn>;
|
|
loadReservations: ReturnType<typeof vi.fn>;
|
|
loadBudgetItems: ReturnType<typeof vi.fn>;
|
|
loadFiles: ReturnType<typeof vi.fn>;
|
|
refreshDays: ReturnType<typeof vi.fn>;
|
|
setAssignmentTimes: ReturnType<typeof vi.fn>;
|
|
setAssignmentNotes: ReturnType<typeof vi.fn>;
|
|
addPlace: ReturnType<typeof vi.fn>;
|
|
updatePlace: ReturnType<typeof vi.fn>;
|
|
deletePlace: ReturnType<typeof vi.fn>;
|
|
deletePlacesMany: ReturnType<typeof vi.fn>;
|
|
updatePlacesMany: ReturnType<typeof vi.fn>;
|
|
addFile: ReturnType<typeof vi.fn>;
|
|
assignPlaceToDay: ReturnType<typeof vi.fn>;
|
|
removeAssignment: ReturnType<typeof vi.fn>;
|
|
reorderAssignments: ReturnType<typeof vi.fn>;
|
|
reorderDays: ReturnType<typeof vi.fn>;
|
|
insertDay: ReturnType<typeof vi.fn>;
|
|
appendDatedDay: ReturnType<typeof vi.fn>;
|
|
deleteDay: ReturnType<typeof vi.fn>;
|
|
updateDayTitle: ReturnType<typeof vi.fn>;
|
|
addReservation: ReturnType<typeof vi.fn>;
|
|
updateReservation: ReturnType<typeof vi.fn>;
|
|
deleteReservation: ReturnType<typeof vi.fn>;
|
|
setSelectedDay: ReturnType<typeof vi.fn>;
|
|
}
|
|
|
|
export function makeActions(): PlannerActions {
|
|
return {
|
|
loadTrip: vi.fn(async () => undefined),
|
|
loadReservations: vi.fn(async () => undefined),
|
|
loadBudgetItems: vi.fn(async () => undefined),
|
|
loadFiles: vi.fn(async () => undefined),
|
|
refreshDays: vi.fn(async () => undefined),
|
|
setAssignmentTimes: vi.fn(async () => undefined),
|
|
setAssignmentNotes: vi.fn(async () => undefined),
|
|
addPlace: vi.fn(async () => ({ id: 900, name: 'New' })),
|
|
updatePlace: vi.fn(async () => undefined),
|
|
deletePlace: vi.fn(async () => undefined),
|
|
deletePlacesMany: vi.fn(async () => undefined),
|
|
updatePlacesMany: vi.fn(async () => undefined),
|
|
addFile: vi.fn(async () => undefined),
|
|
assignPlaceToDay: vi.fn(async () => ({ id: 555 })),
|
|
removeAssignment: vi.fn(async () => undefined),
|
|
reorderAssignments: vi.fn(async () => undefined),
|
|
reorderDays: vi.fn(async () => undefined),
|
|
insertDay: vi.fn(async () => undefined),
|
|
appendDatedDay: vi.fn(async () => ({ id: 99, date: '2026-06-04' })),
|
|
deleteDay: vi.fn(async () => undefined),
|
|
updateDayTitle: vi.fn(async () => undefined),
|
|
addReservation: vi.fn(async () => ({ id: 77 })),
|
|
updateReservation: vi.fn(async () => ({ id: 77 })),
|
|
deleteReservation: vi.fn(async () => undefined),
|
|
setSelectedDay: vi.fn(() => undefined),
|
|
};
|
|
}
|