mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-09-08 20:52:11 +00:00
* remove an unused helper * move a single-use helper to its call-site as a getter * convert `format-currency` to a pure function helper
18 lines
619 B
JavaScript
18 lines
619 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("formats USD correctly", function (assert) {
|
|
const result = formatCurrency("USD", 338.2);
|
|
assert.equal(result, "$338.20", "Formats USD correctly");
|
|
});
|
|
|
|
test("rounds correctly", function (assert) {
|
|
const result = formatCurrency("USD", 338.289);
|
|
assert.equal(result, "$338.29", "Rounds correctly");
|
|
});
|
|
});
|