diff --git a/package-lock.json b/package-lock.json index 24518dbb..f5b76981 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "vue-router": "^4.2.5" }, "devDependencies": { + "@pinia/testing": "^0.1.3", "@storybook/addon-actions": "^7.6.7", "@storybook/addon-docs": "^7.6.7", "@storybook/addon-essentials": "^7.6.7", @@ -3184,6 +3185,47 @@ "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==", "dev": true }, + "node_modules/@pinia/testing": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@pinia/testing/-/testing-0.1.3.tgz", + "integrity": "sha512-D2Ds2s69kKFaRf2KCcP1NhNZEg5+we59aRyQalwRm7ygWfLM25nDH66267U3hNvRUOTx8ofL24GzodZkOmB5xw==", + "dev": true, + "dependencies": { + "vue-demi": ">=0.14.5" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "pinia": ">=2.1.5" + } + }, + "node_modules/@pinia/testing/node_modules/vue-demi": { + "version": "0.14.6", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", + "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", + "dev": true, + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", diff --git a/package.json b/package.json index a5e7376c..8afc5b23 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "vue-router": "^4.2.5" }, "devDependencies": { + "@pinia/testing": "^0.1.3", "@storybook/addon-actions": "^7.6.7", "@storybook/addon-docs": "^7.6.7", "@storybook/addon-essentials": "^7.6.7", diff --git a/src/api/currencies.ts b/src/api/currencies.ts index cef0b05d..1e1492b0 100644 --- a/src/api/currencies.ts +++ b/src/api/currencies.ts @@ -45,3 +45,7 @@ export const addUserCurrencies = async ( ) => ( api.post('/user/currencies', { currencies }) ); + +export const loadUserBaseCurrency = (): Promise => ( + api.get('/user/currencies/base') +); diff --git a/src/api/index.ts b/src/api/index.ts index f38ea53b..891e4f51 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -6,3 +6,4 @@ export * from './monobank'; export * from './auth'; export * from './transactions'; export * from './stats'; +export * from './currencies'; diff --git a/src/components/fields/category-select-field.vue b/src/components/fields/category-select-field.vue index 32631619..7b48fc2f 100644 --- a/src/components/fields/category-select-field.vue +++ b/src/components/fields/category-select-field.vue @@ -5,6 +5,7 @@ 'category-select-field--active': isDropdownOpened, }" class="category-select-field" + data-test="category-select-field" > - {{ selectedValue.name || placeholder }} + {{ selectedValue?.name || placeholder }}
@@ -58,6 +61,8 @@ :class="{ 'category-select-field__dropdown-item--highlighed': selectedValue.id === topLevelCategory.id, }" + role="option" + :aria-selected="selectedValue.id === topLevelCategory.id" @click="selectItem(topLevelCategory, true)" > @@ -86,6 +91,8 @@ :class="{ 'category-select-field__dropdown-item--highlighed': selectedValue.id === item.id, }" + role="option" + :aria-selected="selectedValue.id === item.id" @click="selectItem(item)" > diff --git a/src/components/modals/modify-record/index.test.ts b/src/components/modals/modify-record/index.test.ts new file mode 100644 index 00000000..7e5cc560 --- /dev/null +++ b/src/components/modals/modify-record/index.test.ts @@ -0,0 +1,86 @@ +import { mount } from '@vue/test-utils'; +import { router } from '@/routes'; +import { createTestingPinia } from '@pinia/testing'; +import { VueQueryPlugin } from '@tanstack/vue-query'; +import * as dataMocks from '@tests/mocks'; +import * as apiMethods from '@/api'; +import { TRANSACTION_TYPES } from 'shared-types'; +import FormComponent from './index.vue'; + +describe('transactions create/update/delete form', () => { + beforeAll(() => { + // jsdom doesn't implement this method so we're adding our own + Element.prototype.scrollTo = () => {}; + }); + afterEach(() => { + vi.resetAllMocks(); + }); + + const mountComponent = () => mount(FormComponent, { + global: { + plugins: [ + createTestingPinia({ + initialState: { + user: { user: dataMocks.USER }, + currencies: { + currencies: dataMocks.USER_CURRENCIES, + systemCurrencies: dataMocks.SYSTEM_CURRENCIES, + baseCurrency: dataMocks.USER_BASE_CURRENCY, + }, + categories: { + categories: dataMocks.USER_CATEGORIES, + }, + }, + }), + VueQueryPlugin, + router, + ], + directives: { + 'click-outside': () => {}, + }, + }, + }); + + describe('transaction creation', () => { + test.each([ + ['income transaction', 'button[aria-label="Select income"]', TRANSACTION_TYPES.income], + ['expense transaction', 'button[aria-label="Select expense"]', TRANSACTION_TYPES.expense], + ])('%s', async (_, formTypeSelector, expected) => { + vi.spyOn(apiMethods, 'loadAccounts').mockReturnValue(Promise.resolve(dataMocks.ACCOUNTS)); + const createTxSpy = vi.spyOn(apiMethods, 'createTransaction'); + + const wrapper = mountComponent(); + + await wrapper.find(formTypeSelector).trigger('click'); + + const amountField = wrapper.find('input[placeholder="Amount"]'); + await amountField.setValue(10); + + const accountField = wrapper.find('[title="Select account"]'); + await accountField.trigger('click'); + const desiredAccountBtn = wrapper.find('button[role="option"]'); + await desiredAccountBtn.trigger('click'); + + const categoryField = wrapper.find('[title="Select category"]'); + await categoryField.trigger('click'); + let desiredCategoryBtn = wrapper.find('[data-test="category-select-field"] button[role="option"]'); + await desiredCategoryBtn.trigger('click'); + // Since that's how category selector works, we need to select it one more time + desiredCategoryBtn = wrapper.find('[data-test="category-select-field"] button[role="option"]'); + await desiredCategoryBtn.trigger('click'); + + const submitBtn = wrapper.find('[aria-label="Create transaction"]'); + await submitBtn.trigger('click'); + + expect(createTxSpy).toHaveBeenCalledWith({ + amount: '10', + note: null, + time: expect.any(String), + transactionType: expected, + paymentType: expect.any(String), + accountId: dataMocks.ACCOUNTS[0].id, + categoryId: dataMocks.USER_CATEGORIES[0].id, + }); + }); + }); +}); diff --git a/src/components/modals/modify-record/index.vue b/src/components/modals/modify-record/index.vue index cbf2df1b..15048d0d 100644 --- a/src/components/modals/modify-record/index.vue +++ b/src/components/modals/modify-record/index.vue @@ -9,17 +9,15 @@ import { import { storeToRefs } from 'pinia'; import { useQueryClient } from '@tanstack/vue-query'; import { - type AccountModel, TRANSACTION_TYPES, PAYMENT_TYPES, type TransactionModel, ACCOUNT_TYPES, - type CategoryModel, TRANSACTION_TRANSFER_NATURE, } from 'shared-types'; import { useAccountsStore, useCategoriesStore, useCurrenciesStore } from '@/stores'; -import { createTransaction, editTransaction, deleteTransaction } from '@/api/transactions'; -import { type VerbosePaymentType, VERBOSE_PAYMENT_TYPES, OUT_OF_WALLET_ACCOUNT_MOCK } from '@/common/const'; +import { createTransaction, editTransaction, deleteTransaction } from '@/api'; +import { VERBOSE_PAYMENT_TYPES, OUT_OF_WALLET_ACCOUNT_MOCK, VUE_QUERY_TX_CHANGE_QUERY } from '@/common/const'; import InputField from '@/components/fields/input-field.vue'; import SelectField from '@/components/fields/select-field.vue'; import CategorySelectField from '@/components/fields/category-select-field.vue'; @@ -27,12 +25,11 @@ import TextareaField from '@/components/fields/textarea-field.vue'; import DateField from '@/components/fields/date-field.vue'; import UiButton from '@/components/common/ui-button.vue'; import { EVENTS as MODAL_EVENTS } from '@/components/modal-center/ui-modal.vue'; -import { VUE_QUERY_TX_CHANGE_QUERY } from '@/common/const'; import FormHeader from './form-header.vue'; import TypeSelector from './type-selector.vue'; import FormRow from './form-row.vue'; import AccountField from './account-field.vue'; -import { FORM_TYPES } from './types'; +import { FORM_TYPES, UI_FORM_STRUCT } from './types'; import { getDestinationAccount, getDestinationAmount, @@ -65,17 +62,7 @@ const queryClient = useQueryClient(); const isFormCreation = computed(() => !props.transaction); -const form = ref<{ - amount: number; - account: AccountModel; - toAccount?: AccountModel; - category: CategoryModel; - time: string; - paymentType: VerbosePaymentType; - note?: string; - type: FORM_TYPES; - targetAmount?: number; -}>({ +const form = ref({ amount: null, account: null, toAccount: null, @@ -519,10 +506,11 @@ onMounted(() => { modify-record__action modify-record__action--submit " + :aria-label="isFormCreation ? 'Create transaction' : 'Edit transaction'" :disabled="isLoading" @click="submit" > - {{ isLoading ? 'Loading...' : transaction ? 'Edit' : 'Submit' }} + {{ isLoading ? 'Loading...' : isFormCreation ? 'Submit' : 'Edit' }}
diff --git a/src/components/modals/modify-record/type-selector.vue b/src/components/modals/modify-record/type-selector.vue index 55370ddc..33e6325b 100644 --- a/src/components/modals/modify-record/type-selector.vue +++ b/src/components/modals/modify-record/type-selector.vue @@ -8,6 +8,8 @@ 'type-selector__item--disabled': isExpenseDisabled, 'type-selector__item--active': selectedTransactionType === FORM_TYPES.expense, }" + aria-label="Select expense" + :aria-selected="selectedTransactionType === FORM_TYPES.expense" @click="selectTransactionType(FORM_TYPES.expense)" > Expense @@ -20,6 +22,8 @@ 'type-selector__item--disabled': isIncomeDisabled, 'type-selector__item--active': selectedTransactionType === FORM_TYPES.income, }" + aria-label="Select income" + :aria-selected="selectedTransactionType === FORM_TYPES.income" @click="selectTransactionType(FORM_TYPES.income)" > Income @@ -30,6 +34,8 @@ :class="{ 'type-selector__item--active': selectedTransactionType === FORM_TYPES.transfer, }" + aria-label="Select transfer" + :aria-selected="selectedTransactionType === FORM_TYPES.transfer" @click="selectTransactionType(FORM_TYPES.transfer)" > Transfer diff --git a/src/components/modals/modify-record/types.ts b/src/components/modals/modify-record/types.ts index 1ba04e43..754fe405 100644 --- a/src/components/modals/modify-record/types.ts +++ b/src/components/modals/modify-record/types.ts @@ -1,5 +1,20 @@ +import { AccountModel, CategoryModel } from 'shared-types'; +import type { VerbosePaymentType } from '@/common/const'; + export enum FORM_TYPES { income = 'income', expense = 'expense', transfer = 'transfer', } + +export interface UI_FORM_STRUCT { + amount: number; + account: AccountModel; + toAccount?: AccountModel; + category: CategoryModel; + time: string; + paymentType: VerbosePaymentType; + note?: string; + type: FORM_TYPES; + targetAmount?: number; +} diff --git a/src/stores/currencies.ts b/src/stores/currencies.ts index 4c375ad7..52829f05 100644 --- a/src/stores/currencies.ts +++ b/src/stores/currencies.ts @@ -1,10 +1,10 @@ import { ref, computed } from 'vue'; import { defineStore } from 'pinia'; -import { api } from '@/api/_api'; import { getAllCurrencies, loadUserCurrencies, setBaseUserCurrency, + loadUserBaseCurrency, } from '@/api/currencies'; import { CurrencyModel, UserCurrencyModel } from 'shared-types'; @@ -31,9 +31,12 @@ export const useCurrenciesStore = defineStore('currencies', () => { ); const loadCurrencies = async () => { - currencies.value = await loadUserCurrencies(); + const [userCurrencies, systemOnes] = await Promise.all( + [loadUserCurrencies(), getAllCurrencies()], + ); - systemCurrencies.value = await getAllCurrencies(); + currencies.value = userCurrencies; + systemCurrencies.value = systemOnes; }; const getCurrency = (currencyId: number) => ( @@ -41,7 +44,7 @@ export const useCurrenciesStore = defineStore('currencies', () => { ); const loadBaseCurrency = async () => { - const result: UserCurrencyModel = await api.get('/user/currencies/base'); + const result = await loadUserBaseCurrency(); if (result) { baseCurrency.value = result; diff --git a/tests/mocks/accounts.ts b/tests/mocks/accounts.ts new file mode 100644 index 00000000..40f46638 --- /dev/null +++ b/tests/mocks/accounts.ts @@ -0,0 +1,72 @@ +import { AccountModel, ACCOUNT_TYPES } from 'shared-types'; + +export const ACCOUNTS: AccountModel[] = [ + { + id: 127, + name: 'Test EUR', + initialBalance: 0, + refInitialBalance: 0, + currentBalance: 9, + refCurrentBalance: 322.65, + creditLimit: 0, + refCreditLimit: 0, + type: ACCOUNT_TYPES.system, + accountTypeId: 1, + currencyId: 769, + userId: 40, + externalId: null, + externalData: null, + isEnabled: true, + }, + { + id: 125, + name: 'Test USD', + initialBalance: 0, + refInitialBalance: 0, + currentBalance: 20, + refCurrentBalance: 745.99, + creditLimit: 0, + refCreditLimit: 0, + type: ACCOUNT_TYPES.system, + accountTypeId: 1, + currencyId: 869, + userId: 40, + externalId: null, + externalData: null, + isEnabled: true, + }, + { + id: 126, + name: 'Acc UAH', + initialBalance: 0, + refInitialBalance: 0, + currentBalance: 0, + refCurrentBalance: 0, + creditLimit: 0, + refCreditLimit: 0, + type: ACCOUNT_TYPES.system, + accountTypeId: 1, + currencyId: 867, + userId: 40, + externalId: null, + externalData: null, + isEnabled: true, + }, + { + id: 128, + name: 'Test UAH (2)', + initialBalance: 0, + refInitialBalance: 0, + currentBalance: 0, + refCurrentBalance: 0, + creditLimit: 0, + refCreditLimit: 0, + type: ACCOUNT_TYPES.system, + accountTypeId: 1, + currencyId: 867, + userId: 40, + externalId: null, + externalData: null, + isEnabled: true, + }, +]; diff --git a/tests/mocks/categories.ts b/tests/mocks/categories.ts new file mode 100644 index 00000000..a4e16264 --- /dev/null +++ b/tests/mocks/categories.ts @@ -0,0 +1,722 @@ +export const USER_CATEGORIES = [ + { + id: 3121, + name: 'Food & Drinks', + imageUrl: null, + color: '#e74c3c', + type: 'custom', + parentId: null, + userId: 40, + }, + { + id: 3122, + name: 'Shopping', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: null, + userId: 40, + }, + { + id: 3123, + name: 'Housing', + imageUrl: null, + color: '#e67e22', + type: 'custom', + parentId: null, + userId: 40, + }, + { + id: 3124, + name: 'Transportation', + imageUrl: null, + color: '#95a5a6', + type: 'custom', + parentId: null, + userId: 40, + }, + { + id: 3125, + name: 'Veniche', + imageUrl: null, + color: '#8e44ad', + type: 'custom', + parentId: null, + userId: 40, + }, + { + id: 3126, + name: 'Life & Entertainment', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: null, + userId: 40, + }, + { + id: 3127, + name: 'Communication, PC', + imageUrl: null, + color: '#2980b9', + type: 'custom', + parentId: null, + userId: 40, + }, + { + id: 3128, + name: 'Financial expenses', + imageUrl: null, + color: '#16a085', + type: 'custom', + parentId: null, + userId: 40, + }, + { + id: 3129, + name: 'Investments', + imageUrl: null, + color: '#fda7df', + type: 'custom', + parentId: null, + userId: 40, + }, + { + id: 3130, + name: 'Income', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: null, + userId: 40, + }, + { + id: 3131, + name: 'Other', + imageUrl: null, + color: '#7f8c8d', + type: 'internal', + parentId: null, + userId: 40, + }, + { + id: 3132, + name: 'Groceries', + imageUrl: null, + color: '#e74c3c', + type: 'custom', + parentId: 3121, + userId: 40, + }, + { + id: 3133, + name: 'Restaurane, fast-food', + imageUrl: null, + color: '#e74c3c', + type: 'custom', + parentId: 3121, + userId: 40, + }, + { + id: 3134, + name: 'Bar, cafe', + imageUrl: null, + color: '#e74c3c', + type: 'custom', + parentId: 3121, + userId: 40, + }, + { + id: 3135, + name: 'Clothes & shoes', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3136, + name: 'Jewels, accessories', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3137, + name: 'Health and beauty', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3138, + name: 'Kids', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3139, + name: 'Home, garden', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3140, + name: 'Pets, animals', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3141, + name: 'Electronics, accessories', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3142, + name: 'Gifts, joy', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3143, + name: 'Stationery, tools', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3144, + name: 'Free time', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3145, + name: 'Drug-store, chemist', + imageUrl: null, + color: '#3498db', + type: 'custom', + parentId: 3122, + userId: 40, + }, + { + id: 3146, + name: 'Rent', + imageUrl: null, + color: '#e67e22', + type: 'custom', + parentId: 3123, + userId: 40, + }, + { + id: 3147, + name: 'Mortgage', + imageUrl: null, + color: '#e67e22', + type: 'custom', + parentId: 3123, + userId: 40, + }, + { + id: 3148, + name: 'Energy, utilities', + imageUrl: null, + color: '#e67e22', + type: 'custom', + parentId: 3123, + userId: 40, + }, + { + id: 3149, + name: 'Services', + imageUrl: null, + color: '#e67e22', + type: 'custom', + parentId: 3123, + userId: 40, + }, + { + id: 3150, + name: 'Maintenance, repairs', + imageUrl: null, + color: '#e67e22', + type: 'custom', + parentId: 3123, + userId: 40, + }, + { + id: 3151, + name: 'Property insurance', + imageUrl: null, + color: '#e67e22', + type: 'custom', + parentId: 3123, + userId: 40, + }, + { + id: 3152, + name: 'Public transport', + imageUrl: null, + color: '#95a5a6', + type: 'custom', + parentId: 3124, + userId: 40, + }, + { + id: 3153, + name: 'Taxi', + imageUrl: null, + color: '#95a5a6', + type: 'custom', + parentId: 3124, + userId: 40, + }, + { + id: 3154, + name: 'Long distance', + imageUrl: null, + color: '#95a5a6', + type: 'custom', + parentId: 3124, + userId: 40, + }, + { + id: 3155, + name: 'Business trips', + imageUrl: null, + color: '#95a5a6', + type: 'custom', + parentId: 3124, + userId: 40, + }, + { + id: 3156, + name: 'Fuel', + imageUrl: null, + color: '#8e44ad', + type: 'custom', + parentId: 3125, + userId: 40, + }, + { + id: 3157, + name: 'Parking', + imageUrl: null, + color: '#8e44ad', + type: 'custom', + parentId: 3125, + userId: 40, + }, + { + id: 3158, + name: 'Vaniche maintenance', + imageUrl: null, + color: '#8e44ad', + type: 'custom', + parentId: 3125, + userId: 40, + }, + { + id: 3159, + name: 'Rentals', + imageUrl: null, + color: '#8e44ad', + type: 'custom', + parentId: 3125, + userId: 40, + }, + { + id: 3160, + name: 'Venicle insurance', + imageUrl: null, + color: '#8e44ad', + type: 'custom', + parentId: 3125, + userId: 40, + }, + { + id: 3161, + name: 'Leasing', + imageUrl: null, + color: '#8e44ad', + type: 'custom', + parentId: 3125, + userId: 40, + }, + { + id: 3162, + name: 'Helth care, doctor', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3163, + name: 'Wellness, beauty', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3164, + name: 'Active sport, fitness', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3165, + name: 'Culture, sport events', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3166, + name: 'Hobbies', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3167, + name: 'Education, development', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3168, + name: 'Books, audio, subscriptions', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3169, + name: 'TV, Streaming', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3170, + name: 'Holiday, trips, hotels', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3171, + name: 'Charity, gifts', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3172, + name: 'Alcohol, tobacco', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3173, + name: 'Lottery, gambling', + imageUrl: null, + color: '#2ecc71', + type: 'custom', + parentId: 3126, + userId: 40, + }, + { + id: 3174, + name: 'Phone, cell phone', + imageUrl: null, + color: '#2980b9', + type: 'custom', + parentId: 3127, + userId: 40, + }, + { + id: 3175, + name: 'Internet', + imageUrl: null, + color: '#2980b9', + type: 'custom', + parentId: 3127, + userId: 40, + }, + { + id: 3176, + name: 'Software, apps, games', + imageUrl: null, + color: '#2980b9', + type: 'custom', + parentId: 3127, + userId: 40, + }, + { + id: 3177, + name: 'Postal services', + imageUrl: null, + color: '#2980b9', + type: 'custom', + parentId: 3127, + userId: 40, + }, + { + id: 3178, + name: 'Taxes', + imageUrl: null, + color: '#16a085', + type: 'custom', + parentId: 3128, + userId: 40, + }, + { + id: 3179, + name: 'Insurances', + imageUrl: null, + color: '#16a085', + type: 'custom', + parentId: 3128, + userId: 40, + }, + { + id: 3180, + name: 'Loan, interests', + imageUrl: null, + color: '#16a085', + type: 'custom', + parentId: 3128, + userId: 40, + }, + { + id: 3181, + name: 'Fines', + imageUrl: null, + color: '#16a085', + type: 'custom', + parentId: 3128, + userId: 40, + }, + { + id: 3182, + name: 'Advisory', + imageUrl: null, + color: '#16a085', + type: 'custom', + parentId: 3128, + userId: 40, + }, + { + id: 3183, + name: 'Charges, Fees', + imageUrl: null, + color: '#16a085', + type: 'custom', + parentId: 3128, + userId: 40, + }, + { + id: 3184, + name: 'Child Support', + imageUrl: null, + color: '#16a085', + type: 'custom', + parentId: 3128, + userId: 40, + }, + { + id: 3185, + name: 'Realty', + imageUrl: null, + color: '#fda7df', + type: 'custom', + parentId: 3129, + userId: 40, + }, + { + id: 3186, + name: 'Venicles, chattels', + imageUrl: null, + color: '#fda7df', + type: 'custom', + parentId: 3129, + userId: 40, + }, + { + id: 3187, + name: 'Financial investments', + imageUrl: null, + color: '#fda7df', + type: 'custom', + parentId: 3129, + userId: 40, + }, + { + id: 3188, + name: 'Savings', + imageUrl: null, + color: '#fda7df', + type: 'custom', + parentId: 3129, + userId: 40, + }, + { + id: 3189, + name: 'Collections', + imageUrl: null, + color: '#fda7df', + type: 'custom', + parentId: 3129, + userId: 40, + }, + { + id: 3190, + name: 'Wage, invoices', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, + { + id: 3191, + name: 'Interests, dividends', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, + { + id: 3192, + name: 'Sale', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, + { + id: 3193, + name: 'Rental income', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, + { + id: 3194, + name: 'Dues & grants', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, + { + id: 3195, + name: 'Lending, renting', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, + { + id: 3196, + name: 'Checks, coupons', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, + { + id: 3197, + name: 'Lottery, gambling', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, + { + id: 3198, + name: 'Refunds (tax, purchase)', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, + { + id: 3199, + name: 'Freelance', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, + { + id: 3200, + name: 'Gifts', + imageUrl: null, + color: '#f1c40f', + type: 'custom', + parentId: 3130, + userId: 40, + }, +]; diff --git a/tests/mocks/currencies.ts b/tests/mocks/currencies.ts new file mode 100644 index 00000000..a06f379e --- /dev/null +++ b/tests/mocks/currencies.ts @@ -0,0 +1,1326 @@ +export const USER_CURRENCIES = [ + { + id: 44, + userId: 40, + currencyId: 769, + exchangeRate: null, + liveRateUpdate: false, + isDefaultCurrency: false, + currency: { + id: 769, + currency: 'Euro', + digits: 2, + number: 978, + code: 'EUR', + isDisabled: false, + }, + }, + { + id: 43, + userId: 40, + currencyId: 867, + exchangeRate: 1, + liveRateUpdate: false, + isDefaultCurrency: true, + currency: { + id: 867, + currency: 'Hryvnia', + digits: 2, + number: 980, + code: 'UAH', + isDisabled: false, + }, + }, + { + id: 45, + userId: 40, + currencyId: 869, + exchangeRate: null, + liveRateUpdate: false, + isDefaultCurrency: false, + currency: { + id: 869, + currency: 'US Dollar', + digits: 2, + number: 840, + code: 'USD', + isDisabled: false, + }, + }, +]; + +export const USER_BASE_CURRENCY = { + id: 43, + userId: 40, + currencyId: 867, + exchangeRate: 1, + liveRateUpdate: false, + isDefaultCurrency: true, + currency: { + id: 867, + currency: 'Hryvnia', + digits: 2, + number: 980, + code: 'UAH', + isDisabled: false, + }, +}; + +export const SYSTEM_CURRENCIES = [ + { + id: 721, + currency: 'UAE Dirham', + digits: 2, + number: 784, + code: 'AED', + isDisabled: false, + }, + { + id: 722, + currency: 'Afghani', + digits: 2, + number: 971, + code: 'AFN', + isDisabled: false, + }, + { + id: 723, + currency: 'Lek', + digits: 2, + number: 8, + code: 'ALL', + isDisabled: false, + }, + { + id: 724, + currency: 'Armenian Dram', + digits: 2, + number: 51, + code: 'AMD', + isDisabled: false, + }, + { + id: 725, + currency: 'Netherlands Antillean Guilder', + digits: 2, + number: 532, + code: 'ANG', + isDisabled: false, + }, + { + id: 726, + currency: 'Kwanza', + digits: 2, + number: 973, + code: 'AOA', + isDisabled: false, + }, + { + id: 727, + currency: 'Argentine Peso', + digits: 2, + number: 32, + code: 'ARS', + isDisabled: false, + }, + { + id: 728, + currency: 'Australian Dollar', + digits: 2, + number: 36, + code: 'AUD', + isDisabled: false, + }, + { + id: 729, + currency: 'Aruban Florin', + digits: 2, + number: 533, + code: 'AWG', + isDisabled: false, + }, + { + id: 730, + currency: 'Azerbaijan Manat', + digits: 2, + number: 944, + code: 'AZN', + isDisabled: false, + }, + { + id: 731, + currency: 'Convertible Mark', + digits: 2, + number: 977, + code: 'BAM', + isDisabled: false, + }, + { + id: 732, + currency: 'Barbados Dollar', + digits: 2, + number: 52, + code: 'BBD', + isDisabled: false, + }, + { + id: 733, + currency: 'Taka', + digits: 2, + number: 50, + code: 'BDT', + isDisabled: false, + }, + { + id: 734, + currency: 'Bulgarian Lev', + digits: 2, + number: 975, + code: 'BGN', + isDisabled: false, + }, + { + id: 735, + currency: 'Bahraini Dinar', + digits: 3, + number: 48, + code: 'BHD', + isDisabled: false, + }, + { + id: 736, + currency: 'Burundi Franc', + digits: 0, + number: 108, + code: 'BIF', + isDisabled: false, + }, + { + id: 737, + currency: 'Bermudian Dollar', + digits: 2, + number: 60, + code: 'BMD', + isDisabled: false, + }, + { + id: 738, + currency: 'Brunei Dollar', + digits: 2, + number: 96, + code: 'BND', + isDisabled: false, + }, + { + id: 739, + currency: 'Boliviano', + digits: 2, + number: 68, + code: 'BOB', + isDisabled: false, + }, + { + id: 741, + currency: 'Brazilian Real', + digits: 2, + number: 986, + code: 'BRL', + isDisabled: false, + }, + { + id: 742, + currency: 'Bahamian Dollar', + digits: 2, + number: 44, + code: 'BSD', + isDisabled: false, + }, + { + id: 743, + currency: 'Ngultrum', + digits: 2, + number: 64, + code: 'BTN', + isDisabled: false, + }, + { + id: 744, + currency: 'Pula', + digits: 2, + number: 72, + code: 'BWP', + isDisabled: false, + }, + { + id: 745, + currency: 'Belarusian Ruble', + digits: 2, + number: 933, + code: 'BYN', + isDisabled: false, + }, + { + id: 746, + currency: 'Belize Dollar', + digits: 2, + number: 84, + code: 'BZD', + isDisabled: false, + }, + { + id: 747, + currency: 'Canadian Dollar', + digits: 2, + number: 124, + code: 'CAD', + isDisabled: false, + }, + { + id: 748, + currency: 'Congolese Franc', + digits: 2, + number: 976, + code: 'CDF', + isDisabled: false, + }, + { + id: 750, + currency: 'Swiss Franc', + digits: 2, + number: 756, + code: 'CHF', + isDisabled: false, + }, + { + id: 752, + currency: 'Unidad de Fomento', + digits: 4, + number: 990, + code: 'CLF', + isDisabled: false, + }, + { + id: 753, + currency: 'Chilean Peso', + digits: 0, + number: 152, + code: 'CLP', + isDisabled: false, + }, + { + id: 754, + currency: 'Yuan Renminbi', + digits: 2, + number: 156, + code: 'CNY', + isDisabled: false, + }, + { + id: 755, + currency: 'Colombian Peso', + digits: 2, + number: 170, + code: 'COP', + isDisabled: false, + }, + { + id: 757, + currency: 'Costa Rican Colon', + digits: 2, + number: 188, + code: 'CRC', + isDisabled: false, + }, + { + id: 758, + currency: 'Peso Convertible', + digits: 2, + number: 931, + code: 'CUC', + isDisabled: false, + }, + { + id: 759, + currency: 'Cuban Peso', + digits: 2, + number: 192, + code: 'CUP', + isDisabled: false, + }, + { + id: 760, + currency: 'Cabo Verde Escudo', + digits: 2, + number: 132, + code: 'CVE', + isDisabled: false, + }, + { + id: 761, + currency: 'Czech Koruna', + digits: 2, + number: 203, + code: 'CZK', + isDisabled: false, + }, + { + id: 762, + currency: 'Djibouti Franc', + digits: 0, + number: 262, + code: 'DJF', + isDisabled: false, + }, + { + id: 763, + currency: 'Danish Krone', + digits: 2, + number: 208, + code: 'DKK', + isDisabled: false, + }, + { + id: 764, + currency: 'Dominican Peso', + digits: 2, + number: 214, + code: 'DOP', + isDisabled: false, + }, + { + id: 765, + currency: 'Algerian Dinar', + digits: 2, + number: 12, + code: 'DZD', + isDisabled: false, + }, + { + id: 766, + currency: 'Egyptian Pound', + digits: 2, + number: 818, + code: 'EGP', + isDisabled: false, + }, + { + id: 767, + currency: 'Nakfa', + digits: 2, + number: 232, + code: 'ERN', + isDisabled: false, + }, + { + id: 768, + currency: 'Ethiopian Birr', + digits: 2, + number: 230, + code: 'ETB', + isDisabled: false, + }, + { + id: 769, + currency: 'Euro', + digits: 2, + number: 978, + code: 'EUR', + isDisabled: false, + }, + { + id: 770, + currency: 'Fiji Dollar', + digits: 2, + number: 242, + code: 'FJD', + isDisabled: false, + }, + { + id: 771, + currency: 'Falkland Islands Pound', + digits: 2, + number: 238, + code: 'FKP', + isDisabled: false, + }, + { + id: 772, + currency: 'Pound Sterling', + digits: 2, + number: 826, + code: 'GBP', + isDisabled: false, + }, + { + id: 773, + currency: 'Lari', + digits: 2, + number: 981, + code: 'GEL', + isDisabled: false, + }, + { + id: 774, + currency: 'Ghana Cedi', + digits: 2, + number: 936, + code: 'GHS', + isDisabled: false, + }, + { + id: 775, + currency: 'Gibraltar Pound', + digits: 2, + number: 292, + code: 'GIP', + isDisabled: false, + }, + { + id: 776, + currency: 'Dalasi', + digits: 2, + number: 270, + code: 'GMD', + isDisabled: false, + }, + { + id: 777, + currency: 'Guinean Franc', + digits: 0, + number: 324, + code: 'GNF', + isDisabled: false, + }, + { + id: 778, + currency: 'Quetzal', + digits: 2, + number: 320, + code: 'GTQ', + isDisabled: false, + }, + { + id: 779, + currency: 'Guyana Dollar', + digits: 2, + number: 328, + code: 'GYD', + isDisabled: false, + }, + { + id: 780, + currency: 'Hong Kong Dollar', + digits: 2, + number: 344, + code: 'HKD', + isDisabled: false, + }, + { + id: 781, + currency: 'Lempira', + digits: 2, + number: 340, + code: 'HNL', + isDisabled: false, + }, + { + id: 782, + currency: 'Kuna', + digits: 2, + number: 191, + code: 'HRK', + isDisabled: false, + }, + { + id: 783, + currency: 'Gourde', + digits: 2, + number: 332, + code: 'HTG', + isDisabled: false, + }, + { + id: 784, + currency: 'Forint', + digits: 2, + number: 348, + code: 'HUF', + isDisabled: false, + }, + { + id: 785, + currency: 'Rupiah', + digits: 2, + number: 360, + code: 'IDR', + isDisabled: false, + }, + { + id: 786, + currency: 'New Israeli Sheqel', + digits: 2, + number: 376, + code: 'ILS', + isDisabled: false, + }, + { + id: 787, + currency: 'Indian Rupee', + digits: 2, + number: 356, + code: 'INR', + isDisabled: false, + }, + { + id: 788, + currency: 'Iraqi Dinar', + digits: 3, + number: 368, + code: 'IQD', + isDisabled: false, + }, + { + id: 789, + currency: 'Iranian Rial', + digits: 2, + number: 364, + code: 'IRR', + isDisabled: false, + }, + { + id: 790, + currency: 'Iceland Krona', + digits: 0, + number: 352, + code: 'ISK', + isDisabled: false, + }, + { + id: 791, + currency: 'Jamaican Dollar', + digits: 2, + number: 388, + code: 'JMD', + isDisabled: false, + }, + { + id: 792, + currency: 'Jordanian Dinar', + digits: 3, + number: 400, + code: 'JOD', + isDisabled: false, + }, + { + id: 793, + currency: 'Yen', + digits: 0, + number: 392, + code: 'JPY', + isDisabled: false, + }, + { + id: 794, + currency: 'Kenyan Shilling', + digits: 2, + number: 404, + code: 'KES', + isDisabled: false, + }, + { + id: 795, + currency: 'Som', + digits: 2, + number: 417, + code: 'KGS', + isDisabled: false, + }, + { + id: 796, + currency: 'Riel', + digits: 2, + number: 116, + code: 'KHR', + isDisabled: false, + }, + { + id: 797, + currency: 'Comorian Franc ', + digits: 0, + number: 174, + code: 'KMF', + isDisabled: false, + }, + { + id: 798, + currency: 'North Korean Won', + digits: 2, + number: 408, + code: 'KPW', + isDisabled: false, + }, + { + id: 799, + currency: 'Won', + digits: 0, + number: 410, + code: 'KRW', + isDisabled: false, + }, + { + id: 800, + currency: 'Kuwaiti Dinar', + digits: 3, + number: 414, + code: 'KWD', + isDisabled: false, + }, + { + id: 801, + currency: 'Cayman Islands Dollar', + digits: 2, + number: 136, + code: 'KYD', + isDisabled: false, + }, + { + id: 802, + currency: 'Tenge', + digits: 2, + number: 398, + code: 'KZT', + isDisabled: false, + }, + { + id: 803, + currency: 'Lao Kip', + digits: 2, + number: 418, + code: 'LAK', + isDisabled: false, + }, + { + id: 804, + currency: 'Lebanese Pound', + digits: 2, + number: 422, + code: 'LBP', + isDisabled: false, + }, + { + id: 805, + currency: 'Sri Lanka Rupee', + digits: 2, + number: 144, + code: 'LKR', + isDisabled: false, + }, + { + id: 806, + currency: 'Liberian Dollar', + digits: 2, + number: 430, + code: 'LRD', + isDisabled: false, + }, + { + id: 807, + currency: 'Loti', + digits: 2, + number: 426, + code: 'LSL', + isDisabled: false, + }, + { + id: 808, + currency: 'Libyan Dinar', + digits: 3, + number: 434, + code: 'LYD', + isDisabled: false, + }, + { + id: 809, + currency: 'Moroccan Dirham', + digits: 2, + number: 504, + code: 'MAD', + isDisabled: false, + }, + { + id: 810, + currency: 'Moldovan Leu', + digits: 2, + number: 498, + code: 'MDL', + isDisabled: false, + }, + { + id: 811, + currency: 'Malagasy Ariary', + digits: 2, + number: 969, + code: 'MGA', + isDisabled: false, + }, + { + id: 812, + currency: 'Denar', + digits: 2, + number: 807, + code: 'MKD', + isDisabled: false, + }, + { + id: 813, + currency: 'Kyat', + digits: 2, + number: 104, + code: 'MMK', + isDisabled: false, + }, + { + id: 814, + currency: 'Tugrik', + digits: 2, + number: 496, + code: 'MNT', + isDisabled: false, + }, + { + id: 815, + currency: 'Pataca', + digits: 2, + number: 446, + code: 'MOP', + isDisabled: false, + }, + { + id: 817, + currency: 'Mauritius Rupee', + digits: 2, + number: 480, + code: 'MUR', + isDisabled: false, + }, + { + id: 818, + currency: 'Rufiyaa', + digits: 2, + number: 462, + code: 'MVR', + isDisabled: false, + }, + { + id: 819, + currency: 'Malawi Kwacha', + digits: 2, + number: 454, + code: 'MWK', + isDisabled: false, + }, + { + id: 820, + currency: 'Mexican Peso', + digits: 2, + number: 484, + code: 'MXN', + isDisabled: false, + }, + { + id: 822, + currency: 'Malaysian Ringgit', + digits: 2, + number: 458, + code: 'MYR', + isDisabled: false, + }, + { + id: 823, + currency: 'Mozambique Metical', + digits: 2, + number: 943, + code: 'MZN', + isDisabled: false, + }, + { + id: 824, + currency: 'Namibia Dollar', + digits: 2, + number: 516, + code: 'NAD', + isDisabled: false, + }, + { + id: 825, + currency: 'Naira', + digits: 2, + number: 566, + code: 'NGN', + isDisabled: false, + }, + { + id: 826, + currency: 'Cordoba Oro', + digits: 2, + number: 558, + code: 'NIO', + isDisabled: false, + }, + { + id: 827, + currency: 'Norwegian Krone', + digits: 2, + number: 578, + code: 'NOK', + isDisabled: false, + }, + { + id: 828, + currency: 'Nepalese Rupee', + digits: 2, + number: 524, + code: 'NPR', + isDisabled: false, + }, + { + id: 829, + currency: 'New Zealand Dollar', + digits: 2, + number: 554, + code: 'NZD', + isDisabled: false, + }, + { + id: 830, + currency: 'Rial Omani', + digits: 3, + number: 512, + code: 'OMR', + isDisabled: false, + }, + { + id: 831, + currency: 'Balboa', + digits: 2, + number: 590, + code: 'PAB', + isDisabled: false, + }, + { + id: 832, + currency: 'Sol', + digits: 2, + number: 604, + code: 'PEN', + isDisabled: false, + }, + { + id: 833, + currency: 'Kina', + digits: 2, + number: 598, + code: 'PGK', + isDisabled: false, + }, + { + id: 834, + currency: 'Philippine Peso', + digits: 2, + number: 608, + code: 'PHP', + isDisabled: false, + }, + { + id: 835, + currency: 'Pakistan Rupee', + digits: 2, + number: 586, + code: 'PKR', + isDisabled: false, + }, + { + id: 836, + currency: 'Zloty', + digits: 2, + number: 985, + code: 'PLN', + isDisabled: false, + }, + { + id: 837, + currency: 'Guarani', + digits: 0, + number: 600, + code: 'PYG', + isDisabled: false, + }, + { + id: 838, + currency: 'Qatari Rial', + digits: 2, + number: 634, + code: 'QAR', + isDisabled: false, + }, + { + id: 839, + currency: 'Romanian Leu', + digits: 2, + number: 946, + code: 'RON', + isDisabled: false, + }, + { + id: 840, + currency: 'Serbian Dinar', + digits: 2, + number: 941, + code: 'RSD', + isDisabled: false, + }, + { + id: 841, + currency: 'Russian Ruble', + digits: 2, + number: 643, + code: 'RUB', + isDisabled: false, + }, + { + id: 842, + currency: 'Rwanda Franc', + digits: 0, + number: 646, + code: 'RWF', + isDisabled: false, + }, + { + id: 843, + currency: 'Saudi Riyal', + digits: 2, + number: 682, + code: 'SAR', + isDisabled: false, + }, + { + id: 844, + currency: 'Solomon Islands Dollar', + digits: 2, + number: 90, + code: 'SBD', + isDisabled: false, + }, + { + id: 845, + currency: 'Seychelles Rupee', + digits: 2, + number: 690, + code: 'SCR', + isDisabled: false, + }, + { + id: 846, + currency: 'Sudanese Pound', + digits: 2, + number: 938, + code: 'SDG', + isDisabled: false, + }, + { + id: 847, + currency: 'Swedish Krona', + digits: 2, + number: 752, + code: 'SEK', + isDisabled: false, + }, + { + id: 848, + currency: 'Singapore Dollar', + digits: 2, + number: 702, + code: 'SGD', + isDisabled: false, + }, + { + id: 849, + currency: 'Saint Helena Pound', + digits: 2, + number: 654, + code: 'SHP', + isDisabled: false, + }, + { + id: 850, + currency: 'Leone', + digits: 2, + number: 694, + code: 'SLL', + isDisabled: false, + }, + { + id: 851, + currency: 'Somali Shilling', + digits: 2, + number: 706, + code: 'SOS', + isDisabled: false, + }, + { + id: 852, + currency: 'Surinam Dollar', + digits: 2, + number: 968, + code: 'SRD', + isDisabled: false, + }, + { + id: 855, + currency: 'El Salvador Colon', + digits: 2, + number: 222, + code: 'SVC', + isDisabled: false, + }, + { + id: 856, + currency: 'Syrian Pound', + digits: 2, + number: 760, + code: 'SYP', + isDisabled: false, + }, + { + id: 857, + currency: 'Lilangeni', + digits: 2, + number: 748, + code: 'SZL', + isDisabled: false, + }, + { + id: 858, + currency: 'Baht', + digits: 2, + number: 764, + code: 'THB', + isDisabled: false, + }, + { + id: 859, + currency: 'Somoni', + digits: 2, + number: 972, + code: 'TJS', + isDisabled: false, + }, + { + id: 860, + currency: 'Turkmenistan New Manat', + digits: 2, + number: 934, + code: 'TMT', + isDisabled: false, + }, + { + id: 861, + currency: 'Tunisian Dinar', + digits: 3, + number: 788, + code: 'TND', + isDisabled: false, + }, + { + id: 862, + currency: 'Pa’anga', + digits: 2, + number: 776, + code: 'TOP', + isDisabled: false, + }, + { + id: 863, + currency: 'Turkish Lira', + digits: 2, + number: 949, + code: 'TRY', + isDisabled: false, + }, + { + id: 864, + currency: 'Trinidad and Tobago Dollar', + digits: 2, + number: 780, + code: 'TTD', + isDisabled: false, + }, + { + id: 865, + currency: 'New Taiwan Dollar', + digits: 2, + number: 901, + code: 'TWD', + isDisabled: false, + }, + { + id: 866, + currency: 'Tanzanian Shilling', + digits: 2, + number: 834, + code: 'TZS', + isDisabled: false, + }, + { + id: 867, + currency: 'Hryvnia', + digits: 2, + number: 980, + code: 'UAH', + isDisabled: false, + }, + { + id: 868, + currency: 'Uganda Shilling', + digits: 0, + number: 800, + code: 'UGX', + isDisabled: false, + }, + { + id: 869, + currency: 'US Dollar', + digits: 2, + number: 840, + code: 'USD', + isDisabled: false, + }, + { + id: 872, + currency: 'Peso Uruguayo', + digits: 2, + number: 858, + code: 'UYU', + isDisabled: false, + }, + { + id: 874, + currency: 'Uzbekistan Sum', + digits: 2, + number: 860, + code: 'UZS', + isDisabled: false, + }, + { + id: 876, + currency: 'Dong', + digits: 0, + number: 704, + code: 'VND', + isDisabled: false, + }, + { + id: 877, + currency: 'Vatu', + digits: 0, + number: 548, + code: 'VUV', + isDisabled: false, + }, + { + id: 878, + currency: 'Tala', + digits: 2, + number: 882, + code: 'WST', + isDisabled: false, + }, + { + id: 879, + currency: 'CFA Franc BEAC', + digits: 0, + number: 950, + code: 'XAF', + isDisabled: false, + }, + { + id: 880, + currency: 'Silver', + digits: 0, + number: 961, + code: 'XAG', + isDisabled: false, + }, + { + id: 881, + currency: 'Gold', + digits: 0, + number: 959, + code: 'XAU', + isDisabled: false, + }, + { + id: 886, + currency: 'East Caribbean Dollar', + digits: 2, + number: 951, + code: 'XCD', + isDisabled: false, + }, + { + id: 887, + currency: 'SDR (Special Drawing Right)', + digits: 0, + number: 960, + code: 'XDR', + isDisabled: false, + }, + { + id: 888, + currency: 'CFA Franc BCEAO', + digits: 0, + number: 952, + code: 'XOF', + isDisabled: false, + }, + { + id: 890, + currency: 'CFP Franc', + digits: 0, + number: 953, + code: 'XPF', + isDisabled: false, + }, + { + id: 896, + currency: 'Yemeni Rial', + digits: 2, + number: 886, + code: 'YER', + isDisabled: false, + }, + { + id: 897, + currency: 'Rand', + digits: 2, + number: 710, + code: 'ZAR', + isDisabled: false, + }, + { + id: 898, + currency: 'Zambian Kwacha', + digits: 2, + number: 967, + code: 'ZMW', + isDisabled: false, + }, + { + id: 899, + currency: 'Zimbabwe Dollar', + digits: 2, + number: 932, + code: 'ZWL', + isDisabled: false, + }, +]; diff --git a/tests/mocks/index.ts b/tests/mocks/index.ts index af47bf88..5581f575 100644 --- a/tests/mocks/index.ts +++ b/tests/mocks/index.ts @@ -1 +1,5 @@ export * from './transactions'; +export * from './accounts'; +export * from './user'; +export * from './currencies'; +export * from './categories'; diff --git a/tests/mocks/user.ts b/tests/mocks/user.ts new file mode 100644 index 00000000..121f4e61 --- /dev/null +++ b/tests/mocks/user.ts @@ -0,0 +1,11 @@ +export const USER = { + id: 40, + username: 'letehaha1', + email: null, + firstName: null, + lastName: null, + middleName: null, + avatar: null, + totalBalance: 0, + defaultCategoryId: 3131, +};