mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 08:30:05 +00:00
test(tours): expect ski_options null on non-ski rows, let the ski choice settle before asserting
This commit is contained in:
@@ -162,6 +162,7 @@ describe('useTourPlanner, a ski and winter tour (SKI-02)', () => {
|
||||
expect(result.current.skiMissing).toBe('technique');
|
||||
expect(result.current.canSave).toBe(false);
|
||||
act(() => result.current.ski.change({ discipline: 'cross_country', technique: 'skating' }));
|
||||
await settle();
|
||||
expect(result.current.skiMissing).toBeNull();
|
||||
expect(result.current.canSave).toBe(true);
|
||||
});
|
||||
@@ -211,6 +212,7 @@ describe('useTourPlanner, a ski and winter tour (SKI-02)', () => {
|
||||
createTour.mockResolvedValue({ tour: saved, waypoints: savedPoints });
|
||||
const { result } = await plannedSki(84);
|
||||
act(() => result.current.ski.change({ discipline: 'winter_hike', technique: 'classic' }));
|
||||
await settle();
|
||||
await act(async () => {
|
||||
await result.current.save();
|
||||
});
|
||||
|
||||
@@ -114,6 +114,7 @@ describe('ToursRepository reads', () => {
|
||||
run_pace_seconds_per_km: null,
|
||||
ski_discipline: null,
|
||||
ski_technique: null,
|
||||
ski_options: null,
|
||||
track_started_at: null,
|
||||
track_ended_at: null,
|
||||
stage_ends: 0,
|
||||
@@ -153,6 +154,7 @@ describe('ToursRepository reads', () => {
|
||||
run_pace_seconds_per_km: null,
|
||||
ski_discipline: null,
|
||||
ski_technique: null,
|
||||
ski_options: null,
|
||||
track_started_at: null,
|
||||
track_ended_at: null,
|
||||
stage_ends: 0,
|
||||
@@ -381,6 +383,7 @@ describe('ToursRepository writes', () => {
|
||||
run_pace_seconds_per_km: null,
|
||||
ski_discipline: null,
|
||||
ski_technique: null,
|
||||
ski_options: null,
|
||||
track_started_at: null,
|
||||
track_ended_at: null,
|
||||
stage_ends: 0,
|
||||
@@ -537,6 +540,7 @@ describe('ToursRepository writes', () => {
|
||||
run_pace_seconds_per_km: null,
|
||||
ski_discipline: null,
|
||||
ski_technique: null,
|
||||
ski_options: null,
|
||||
track_started_at: null,
|
||||
track_ended_at: null,
|
||||
taken_over_from_trip_title: null,
|
||||
|
||||
@@ -200,6 +200,7 @@ describe('ToursService planner contracts (mock-only; SQLite rollback semantics a
|
||||
run_pace_seconds_per_km: null,
|
||||
ski_discipline: null,
|
||||
ski_technique: null,
|
||||
ski_options: null,
|
||||
});
|
||||
expect((setup.toursRepo.insertTour.mock.calls[0][0] as { distance: number }).distance).toBeGreaterThan(0);
|
||||
expect(setup.waypointsRepo.insertForPlace).toHaveBeenCalledExactlyOnceWith(42, keyed(request.waypoints));
|
||||
@@ -322,6 +323,7 @@ describe('ToursService planner contracts (mock-only; SQLite rollback semantics a
|
||||
run_pace_seconds_per_km: null,
|
||||
ski_discipline: null,
|
||||
ski_technique: null,
|
||||
ski_options: null,
|
||||
});
|
||||
expect(setup.waypointsRepo.deleteForPlace).toHaveBeenCalledExactlyOnceWith(42);
|
||||
expect(setup.waypointsRepo.insertForPlace).toHaveBeenCalledExactlyOnceWith(42, keyed(update.waypoints));
|
||||
|
||||
Reference in New Issue
Block a user