first commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { signedTransactionAmount } from './transaction-amount';
|
||||
|
||||
describe('signedTransactionAmount', () => {
|
||||
it('shows debit transaction types as negative amounts', () => {
|
||||
expect(signedTransactionAmount(12, 'fine')).toBe(-12);
|
||||
expect(signedTransactionAmount(12, { id: 14, name: 'expense' })).toBe(-12);
|
||||
});
|
||||
|
||||
it('keeps credits and negative reversal amounts unchanged', () => {
|
||||
expect(signedTransactionAmount(12, 'credit')).toBe(12);
|
||||
expect(signedTransactionAmount(-12, { id: 1, name: 'credit' })).toBe(-12);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user