Skip to content

Commit

Permalink
update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Dec 26, 2024
1 parent 6552ca8 commit 296948e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/unit/TransactionUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ describe('TransactionUtils', () => {
taxRates: CONST.DEFAULT_TAX,
rules: {expenseRules: createCategoryTaxExpenseRules(category, 'id_TAX_RATE_1')},
};
const transaction = generateTransaction();

// When retrieving the tax from the associated category
const transaction = generateTransaction();
const {categoryTaxCode, categoryTaxAmount} = TransactionUtils.getCategoryTaxCodeAndAmount(category, transaction, fakePolicy);

// Then it should return the associated tax code and amount
Expand All @@ -123,9 +123,9 @@ describe('TransactionUtils', () => {
taxRates: CONST.DEFAULT_TAX,
rules: {expenseRules: createCategoryTaxExpenseRules(ruleCategory, 'id_TAX_RATE_1')},
};
const transaction = generateTransaction();

// When retrieving the tax from a category that is not associated with the tax expense rules
const transaction = generateTransaction();
const {categoryTaxCode, categoryTaxAmount} = TransactionUtils.getCategoryTaxCodeAndAmount(selectedCategory, transaction, fakePolicy);

// Then it should return the default tax code and amount
Expand All @@ -134,7 +134,7 @@ describe('TransactionUtils', () => {
});

it("should return the foreign default tax when the category doesn't match the tax expense rules and using a foreign currency", () => {
// Given a policy with tax expense rules associated with a category
// Given a policy with tax expense rules associated with a category and a transaction with a foreign currency
const ruleCategory = 'Advertising';
const selectedCategory = 'Benefits';
const fakePolicy: Policy = {
Expand All @@ -154,9 +154,9 @@ describe('TransactionUtils', () => {
outputCurrency: 'IDR',
rules: {expenseRules: createCategoryTaxExpenseRules(ruleCategory, 'id_TAX_RATE_1')},
};
const transaction = generateTransaction();

// When retrieving the tax from a category that is not associated with the tax expense rules
const transaction = generateTransaction();
const {categoryTaxCode, categoryTaxAmount} = TransactionUtils.getCategoryTaxCodeAndAmount(selectedCategory, transaction, fakePolicy);

// Then it should return the default tax code and amount
Expand All @@ -173,12 +173,12 @@ describe('TransactionUtils', () => {
taxRates: CONST.DEFAULT_TAX,
rules: {expenseRules: createCategoryTaxExpenseRules(category, 'id_TAX_RATE_1')},
};

// When retrieving the tax from the associated category
const transaction: Transaction = {
...generateTransaction(),
iouRequestType: CONST.IOU.REQUEST_TYPE.DISTANCE,
};

// When retrieving the tax from the associated category
const {categoryTaxCode, categoryTaxAmount} = TransactionUtils.getCategoryTaxCodeAndAmount(category, transaction, fakePolicy);

// Then it should return undefined for both the tax code and the tax amount
Expand All @@ -194,9 +194,9 @@ describe('TransactionUtils', () => {
taxRates: CONST.DEFAULT_TAX,
rules: {},
};
const transaction = generateTransaction();

// When retrieving the tax from a category
const transaction = generateTransaction();
const {categoryTaxCode, categoryTaxAmount} = TransactionUtils.getCategoryTaxCodeAndAmount(category, transaction, fakePolicy);

// Then it should return undefined for both the tax code and the tax amount
Expand Down

0 comments on commit 296948e

Please sign in to comment.