Skip to content

Commit 15c2eb6

Browse files
authored
Merge pull request Expensify#65227 from nkdengineer/fix/63923
Split expense total is showing 0 incorrectly in preview
2 parents 604d9a0 + 0ba8548 commit 15c2eb6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/unit/TransactionPreviewUtils.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ describe('TransactionPreviewUtils', () => {
177177

178178
expect(result.previewHeaderText).toContainEqual({translationPath: 'iou.approved'});
179179
});
180+
181+
it('should display the correct amount for a bill split transaction', () => {
182+
const functionArgs = {...basicProps, isBillSplit: true};
183+
const result = getTransactionPreviewTextAndTranslationPaths(functionArgs);
184+
expect(result.displayAmountText.text).toEqual('$1.00');
185+
});
186+
187+
it('should display the correct amount for a bill split transaction after updating the amount', () => {
188+
const functionArgs = {...basicProps, isBillSplit: true, transaction: {...basicProps.transaction, modifiedAmount: 50}};
189+
const result = getTransactionPreviewTextAndTranslationPaths(functionArgs);
190+
expect(result.displayAmountText.text).toEqual('$0.50');
191+
});
180192
});
181193

182194
describe('createTransactionPreviewConditionals', () => {

0 commit comments

Comments
 (0)