diff --git a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx index 60cb799d505..59766bf680a 100644 --- a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx @@ -380,10 +380,10 @@ function CategoryItem({ > {isToBeBudgetedItem ? toBudget != null - ? integerToCurrency(toBudget || 0) + ? ` ${integerToCurrency(toBudget || 0)}` : null : balance != null - ? integerToCurrency(balance || 0) + ? ` ${integerToCurrency(balance || 0)}` : null} diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.test.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.test.jsx index 3b03b5b4fef..8a86d718940 100644 --- a/packages/desktop-client/src/components/transactions/TransactionsTable.test.jsx +++ b/packages/desktop-client/src/components/transactions/TransactionsTable.test.jsx @@ -5,6 +5,7 @@ import userEvent from '@testing-library/user-event'; import { format as formatDate, parse as parseDate } from 'date-fns'; import { v4 as uuidv4 } from 'uuid'; +import { SpreadsheetProvider } from 'loot-core/src/client/SpreadsheetProvider'; import { generateTransaction, generateAccount, @@ -118,26 +119,28 @@ function LiveTransactionTable(props) { return ( - transactions.map(t => t.id)} - > - - {}} - payees={payees} - addNotification={n => console.log(n)} - onSave={onSave} - onSplit={onSplit} - onAdd={onAdd} - onAddSplit={onAddSplit} - onCreatePayee={onCreatePayee} - /> - - + + transactions.map(t => t.id)} + > + + {}} + payees={payees} + addNotification={n => console.log(n)} + onSave={onSave} + onSplit={onSplit} + onAdd={onAdd} + onAddSplit={onAddSplit} + onCreatePayee={onCreatePayee} + /> + + + ); @@ -155,6 +158,9 @@ function initBasicServer() { throw new Error(`queried unknown table: ${query.table}`); } }, + getCell: () => ({ + value: 129_87, + }), }); } @@ -447,7 +453,7 @@ describe('Transactions', () => { let items = tooltip.querySelectorAll('[data-testid*="category-item"]'); expect(items.length).toBe(2); expect(items[0].textContent).toBe('Usual Expenses'); - expect(items[1].textContent).toBe('General'); + expect(items[1].textContent).toBe('General 129.87'); expect(items[1].dataset['highlighted']).toBeDefined(); // It should not allow filtering on group names @@ -473,7 +479,7 @@ describe('Transactions', () => { // The right item should be highlighted highlighted = tooltip.querySelector('[data-highlighted]'); expect(highlighted).not.toBeNull(); - expect(highlighted.textContent).toBe('General'); + expect(highlighted.textContent).toBe('General 129.87'); expect(getTransactions()[2].category).toBe( categories.find(category => category.name === 'Food').id, @@ -515,7 +521,7 @@ describe('Transactions', () => { // Make sure the expected category is highlighted highlighted = tooltip.querySelector('[data-highlighted]'); expect(highlighted).not.toBeNull(); - expect(highlighted.textContent).toBe('General'); + expect(highlighted.textContent).toBe('General 129.87'); // Click the item and check the before/after values expect(getTransactions()[2].category).toBe(