mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
fix(client): work through the findings from the coverage pass
214 items came out of writing the tests. Real defects are corrected, dead code is removed rather than covered, and the tests that pinned the old behaviour move with them. Also drops two agent coverage scratch files that slipped into the coverage PR and adds the ignore rule that keeps them out.
This commit is contained in:
@@ -434,7 +434,7 @@ describe('useMPlanTimeline', () => {
|
||||
expect(useTripStore.getState().reservations.map(r => r.day_positions)).toEqual([{ 2: 0.5 }, undefined])
|
||||
})
|
||||
|
||||
it('FE-MOB-PLTL-024: surfaces a failed reorder as an error toast', async () => {
|
||||
it('FE-MOB-PLTL-024: surfaces a failed reorder as an error toast and refetches the day', async () => {
|
||||
const actions = buildTripActions()
|
||||
actions.reorderAssignments.mockRejectedValue(new Error('offline'))
|
||||
const planner = makePlanner({ tripActions: actions })
|
||||
@@ -442,6 +442,9 @@ describe('useMPlanTimeline', () => {
|
||||
await act(async () => { result.current.moveRow(result.current.merged[0], 'down') })
|
||||
await waitFor(() => expect(planner.toast.error).toHaveBeenCalledWith('offline'))
|
||||
expect(planner.updateRouteForDay).not.toHaveBeenCalled()
|
||||
// The optimistic positions are dropped by refetching, not undone one by one.
|
||||
expect(actions.refreshDays).toHaveBeenCalledWith(1)
|
||||
expect(actions.loadReservations).toHaveBeenCalledWith(1)
|
||||
})
|
||||
|
||||
it('FE-MOB-PLTL-025: falls back to the generic message for a non-Error failure', async () => {
|
||||
|
||||
Reference in New Issue
Block a user