19 lines
704 B
JavaScript
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');
|
|
});
|
|
});
|