Use historic BTC rate for expense items; allow BTC as currency
This commit is contained in:
@@ -39,12 +39,4 @@ 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');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ module('Unit | Service | exchange-rates', function(hooks) {
|
||||
test('#fetchRates', async function(assert) {
|
||||
let service = this.owner.lookup('service:exchange-rates');
|
||||
await service.fetchRates();
|
||||
assert.equal(service.btceur, 9167.57, 'fetches BTCEUR from Bitstamp');
|
||||
assert.equal(service.btcusd, 10749.70, 'fetches BTCUSD from Bitstamp');
|
||||
assert.equal(service.EUR, 9167.57, 'fetches BTCEUR from Bitstamp');
|
||||
assert.equal(service.USD, 10749.70, 'fetches BTCUSD from Bitstamp');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user