spec/js/numbers/currency.spec.js in twitter_cldr_js-2.0.0 vs spec/js/numbers/currency.spec.js in twitter_cldr_js-2.1.0
- old
+ new
@@ -22,10 +22,17 @@
// S/. is the symbol for the Peruvian Nuevo Sol, just in case you were curious
expect(formatter.format(12, {currency: "S/."})).toEqual("S/.12.00");
});
it("should use the currency symbol for the corresponding currency code", function() {
- expect(formatter.format(12, {currency: "PEN"})).toEqual("PEN12.00");
+ expect(formatter.format(12, {currency: "JPY"})).toEqual("¥12.00");
+ });
+
+ it("should use the cldr_symbol for the corresponding currency code if use_cldr_code is specified", function() {
+ TwitterCldr.Currencies.currencies = {
+ "JPY": {symbol: "¥", cldr_symbol: "YEN", currency: "JPY", "name": "Japanese yen"}
+ };
+ expect(formatter.format(12, {currency: "JPY", use_cldr_symbol: true})).toEqual("YEN12.00");
});
it("overrides the default precision", function() {
expect(formatter.format(12, {precision: 3})).toEqual("$12.000");
});
\ No newline at end of file