mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 22:27:32 +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:
@@ -266,12 +266,13 @@ describe('remoteEventHandler > assignments', () => {
|
||||
expect(useTripStore.getState().assignments['10'].map(a => a.id)).toEqual([2, 1]);
|
||||
});
|
||||
|
||||
it('FE-WSEVT-ASSIGN-016: assignment:reordered without orderedIds empties the day list', () => {
|
||||
it('FE-WSEVT-ASSIGN-016: assignment:reordered without orderedIds leaves the day list alone', () => {
|
||||
const existing = buildAssignment({ id: 1, day_id: 10 });
|
||||
useTripStore.setState({
|
||||
days: [buildDay({ id: 10 })],
|
||||
assignments: { '10': [buildAssignment({ id: 1, day_id: 10 })] },
|
||||
assignments: { '10': [existing] },
|
||||
});
|
||||
useTripStore.getState().handleRemoteEvent({ type: 'assignment:reordered', dayId: 10 });
|
||||
expect(useTripStore.getState().assignments['10']).toEqual([]);
|
||||
expect(useTripStore.getState().assignments['10']).toEqual([existing]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -146,8 +146,9 @@ describe('remoteEventHandler > budget', () => {
|
||||
useTripStore.getState().handleRemoteEvent({ type: 'budget:reordered', orderedIds: [3, 1] });
|
||||
const { budgetItems } = useTripStore.getState();
|
||||
expect(budgetItems.map(i => i.id)).toEqual([3, 1, 2]);
|
||||
// Only the listed ids get a fresh sort_order; the unlisted item keeps its own.
|
||||
expect(budgetItems.map(i => i.sort_order)).toEqual([0, 1, 1]);
|
||||
// The whole array is reindexed, so re-sorting by sort_order reproduces the
|
||||
// order that was just applied.
|
||||
expect(budgetItems.map(i => i.sort_order)).toEqual([0, 1, 2]);
|
||||
});
|
||||
|
||||
it('FE-WSEVT-BUDGET-011: an orderedIds entry for an unknown item is dropped', () => {
|
||||
|
||||
Reference in New Issue
Block a user