Skip to content

Open source personal finance application

tests(Trns): fix types

ilkome571df57cae28
diff --git a/tests/trns.mock.ts b/tests/trns.mock.ts
index bb6c17bd..c533e920 100644
--- a/tests/trns.mock.ts
+++ b/tests/trns.mock.ts
@@ -1,83 +1,93 @@
import { TrnType } from '~/components/trns/types'
-import type { TrnTransaction, TrnTransfer, TrnTransferOld } from '~/components/trns/types'
+import type { TrnID, TrnItem } from '~/components/trns/types'
-export const trnsItems = {
+export const trnsItems: Record<TrnID, TrnItem> = {
transactionIncomeWalletCashUSD1000: {
amount: 1000,
+ date: 123456, // TODO: add real dates
categoryId: 'income',
type: TrnType.Income,
walletId: 'walletCashUSD',
- } as TrnTransaction,
+ },
transactionExpenseWalletCashUSD400: {
amount: 400,
+ date: 123456, // TODO: add real dates
categoryId: 'expense',
type: TrnType.Expense,
walletId: 'walletCashUSD',
- } as TrnTransaction,
+ },
transactionIncomeWalletOneRUB700: {
amount: 700,
+ date: 123456, // TODO: add real dates
categoryId: 'category1',
type: TrnType.Income,
walletId: 'walletOneRUB',
- } as TrnTransaction,
+ },
transactionExpenseWalletOneRUB900: {
amount: 900,
+ date: 123456, // TODO: add real dates
categoryId: 'category1',
type: TrnType.Expense,
walletId: 'walletOneRUB',
- } as TrnTransaction,
+ },
transferExpenseWalletCreditUSD40IncomeWalletCashUSD40: {
+ date: 123456, // TODO: add real dates
categoryId: 'transfer',
incomeAmount: 40,
incomeWalletId: 'walletCashUSD',
expenseAmount: 40,
expenseWalletId: 'walletCreditUSD',
type: TrnType.Transfer,
- } as TrnTransfer,
+ },
transferExpenseWalletRUB300IncomeWalletCreditUSD10: {
+ date: 123456, // TODO: add real dates
categoryId: 'transfer',
incomeAmount: 10,
incomeWalletId: 'walletCreditUSD',
expenseAmount: 300,
expenseWalletId: 'walletRUB',
type: TrnType.Transfer,
- } as TrnTransfer,
+ },
transferExpenseWalletCashUSD10IncomeWalletRUB700: {
+ date: 123456, // TODO: add real dates
categoryId: 'transfer',
incomeAmount: 700,
incomeWalletId: 'walletRUB',
expenseAmount: 10,
expenseWalletId: 'walletCashUSD',
type: TrnType.Transfer,
- } as TrnTransfer,
+ },
transferCategoryNameIncomeWalletCashUSD30: {
+ date: 123456, // TODO: add real dates
amount: 30,
categoryId: 'categoryTranferOld',
type: TrnType.Income,
walletId: 'walletCashUSD',
- } as TrnTransaction,
+ },
transferCategoryIdExpenseWalletCashUSD30: {
+ date: 123456, // TODO: add real dates
amount: 30,
categoryId: 'transfer',
type: TrnType.Expense,
walletId: 'walletCashUSD',
- } as TrnTransaction,
+ },
// @deprecated: use New Transaction type instead or Transfer CategoryId
transferOLDExpense2500Income3500: {
+ date: 123456, // TODO: add real dates
categoryId: 'transfer',
type: TrnType.Transfer,
amountFrom: 2500,
walletFromId: 'walletDeprecatedTransferExpense',
amountTo: 3500,
walletToId: 'walletDeprecatedTransferIncome',
- } as TrnTransferOld,
+ },
}