Convert fiat totals to BTC and add to total amount

This commit is contained in:
2020-09-30 16:46:35 +02:00
parent 87bc8f5cb5
commit 63675a1e13
5 changed files with 37 additions and 19 deletions
@@ -39,4 +39,12 @@ module('Unit | Component | add-reimbursement', function(hooks) {
assert.equal(component.totalEUR, '71');
assert.equal(component.totalUSD, '59');
});
test('#updateTotalAmountFromFiat', async function(assert) {
let component = createComponent('component:add-reimbursement');
component.expenses = expenses;
await component.exchangeRates.fetchRates();
component.updateTotalAmountFromFiat();
assert.equal(component.total, '0.01323322', 'converts EUR and USD totals to BTC and rounds to 8 decimals');
});
});