mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2026-03-15 19:21:01 +00:00
18 lines
629 B
JavaScript
18 lines
629 B
JavaScript
import { setupTest } from "ember-qunit";
|
|
import { module, test } from "qunit";
|
|
import { formatCurrency } from "discourse/plugins/discourse-subscriptions/discourse/helpers/format-currency";
|
|
|
|
module("Subscriptions | Unit | Helper | format-currency", function (hooks) {
|
|
setupTest(hooks);
|
|
|
|
test("it formats USD correctly", function (assert) {
|
|
let result = formatCurrency(["USD", 338.2]);
|
|
assert.equal(result, "$338.20", "Formats USD correctly");
|
|
});
|
|
|
|
test("it rounds correctly", function (assert) {
|
|
let result = formatCurrency(["USD", 338.289]);
|
|
assert.equal(result, "$338.29", "Rounds correctly");
|
|
});
|
|
});
|