Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
446 changes: 0 additions & 446 deletions src/app/core/mock-data/dependent-field-expenses.data.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/core/mock-data/expense.data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import deepFreeze from 'deep-freeze-strict';

import { Expense } from '../models/expense.model';
import { ApiV2Response } from '../models/v2/api-v2-response.model';

export const apiExpenseRes: Expense[] = deepFreeze([
Expand Down
222 changes: 0 additions & 222 deletions src/app/core/models/expense.model.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/app/core/models/v1/transaction.model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ExpenseTransactionStatus } from '../../enums/platform/v1/expense-transaction-status.enum';
import { Destination } from '../destination.model';
import { PlatformCategory } from '../platform/platform-category.model';
import { Account } from '../platform/v1/account.model';
import { File } from '../platform/v1/file.model';
import { TxnCustomProperties } from '../txn-custom-properties.model';

Expand Down Expand Up @@ -67,6 +68,7 @@ export interface Transaction {
reported_at?: Date;
skip_reimbursement: boolean;
source: string;
source_account?: Pick<Account, 'id' | 'type'>;
source_account_id?: string;
advance_wallet_id?: string;
split_group_id?: string;
Expand Down
1 change: 0 additions & 1 deletion src/app/core/services/custom-inputs.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
filledDependentFields,
} from '../test-data/custom-inputs.spec.data';
import { CustomInputsService } from './custom-inputs.service';
import { expensesWithDependentFields } from '../mock-data/dependent-field-expenses.data';
import { CustomInput } from '../models/custom-input.model';
import { mockExpenseData } from '../mock-data/expense-field.data';
import { getTranslocoModule } from '../testing/transloco-testing.utils';
Expand Down
68 changes: 0 additions & 68 deletions src/app/core/services/transaction.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,74 +394,6 @@ describe('TransactionService', () => {
expect(transactionService.generateStateOrFilter(filters, params)).toEqual(stateOrFilter);
});

it('getPaymentModeforEtxn(): should return payment mode for etxn', () => {
spyOn(transactionService, 'isEtxnInPaymentMode').and.returnValue(true);
const paymentModeList = [
{
name: 'Reimbursable',
key: 'reimbursable',
},
{
name: 'Non-Reimbursable',
key: 'nonReimbursable',
},
{
name: 'Advance',
key: 'advance',
},
{
name: 'CCC',
key: 'ccc',
},
];
const etxnPaymentMode = { name: 'Reimbursable', key: 'reimbursable' };
// @ts-ignore
expect(transactionService.getPaymentModeForEtxn(expenseData1, paymentModeList)).toEqual(etxnPaymentMode);
expect(transactionService.isEtxnInPaymentMode).toHaveBeenCalledOnceWith(
expenseData1.tx_skip_reimbursement,
expenseData1.source_account_type,
etxnPaymentMode.key,
);
});

describe('isEtxnInPaymentMode():', () => {
it('should return isEtxnInPaymentMode with reimbursable payment mode', () => {
const txnSkipReimbursement = false;
const txnPaymentMode = 'reimbursable';
const txnSourceAccountType = AccountType.PERSONAL;
expect(
transactionService.isEtxnInPaymentMode(txnSkipReimbursement, txnSourceAccountType, txnPaymentMode),
).toBeTrue();
});

it('should return isEtxnInPaymentMode with non-reimbursable payment mode', () => {
const txnSkipReimbursement = true;
const txnPaymentMode = 'nonReimbursable';
const txnSourceAccountType = AccountType.PERSONAL;
expect(
transactionService.isEtxnInPaymentMode(txnSkipReimbursement, txnSourceAccountType, txnPaymentMode),
).toBeTrue();
});

it('should return isEtxnInPaymentMode with advance payment mode', () => {
const txnSkipReimbursement = false;
const txnPaymentMode = 'advance';
const txnSourceAccountType = AccountType.ADVANCE;
expect(
transactionService.isEtxnInPaymentMode(txnSkipReimbursement, txnSourceAccountType, txnPaymentMode),
).toBeTrue();
});

it('should return isEtxnInPaymentMode with advance payment mode', () => {
const txnSkipReimbursement = false;
const txnPaymentMode = 'ccc';
const txnSourceAccountType = AccountType.CCC;
expect(
transactionService.isEtxnInPaymentMode(txnSkipReimbursement, txnSourceAccountType, txnPaymentMode),
).toBeTrue();
});
});

describe('addEtxnToCurrencyMap():', () => {
it('should add a new currency to the map when the currencyMap does not exist', () => {
const currencyMap = {};
Expand Down
Loading
Loading