mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 21:11:14 +00:00
fix(costs): the count beside the total adds up what it does, and its left-out chip counts all again (#2819, #2839)
With a category left out the total card still counted every expense, and in the table view the only way back was to switch views; the chip now brings everything back. The phone says what is left out once, under the total. Linking a receipt offers pictures and PDFs only, like the upload.
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
buildCostsCsv,
|
||||
categoryBreakdown,
|
||||
computeTotals,
|
||||
countedExpenses,
|
||||
currencyOptions,
|
||||
filterBudgetItems,
|
||||
isPlainSplit,
|
||||
@@ -203,4 +204,11 @@ describe('costsModel: categories left out of the totals (#2819)', () => {
|
||||
['food', false, 100],
|
||||
]);
|
||||
});
|
||||
|
||||
it('FE-BUDGET-COSTSMODEL-016: the expense count beside the total counts what the total adds up', () => {
|
||||
const food = expense({ category: 'food', total_price: 40 });
|
||||
const hotel = expense({ category: 'accommodation', total_price: 100 });
|
||||
expect(countedExpenses([food, hotel, food])).toBe(3);
|
||||
expect(countedExpenses([food, hotel, food], new Set<CostCategory>(['food']))).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user