Files
kredits-web/tests/integration/helpers/fmt-fiat-currency-test.js
T
2020-07-09 17:07:05 +02:00

19 lines
704 B
JavaScript

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Helper | fmt-fiat-currency', function(hooks) {
setupRenderingTest(hooks);
test('it returns the number formatted as currency', async function(assert) {
this.set('amount', 13.9);
await render(hbs`{{fmt-fiat-currency this.amount}}`);
assert.equal(this.element.textContent.trim(), '€13.90', 'using EUR amount by default');
await render(hbs`{{fmt-fiat-currency this.amount 'USD'}}`);
assert.equal(this.element.textContent.trim(), '$13.90', 'using the defined currency');
});
});