mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-16 09:01:15 +08:00
17 lines
631 B
JavaScript
17 lines
631 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.strictEqual(result, "$338.20", "Formats USD correctly");
|
|
});
|
|
|
|
test("rounds correctly", function (assert) {
|
|
const result = formatCurrency("USD", 338.289);
|
|
assert.strictEqual(result, "$338.29", "Rounds correctly");
|
|
});
|
|
});
|