Ghost/test/unit/helpers
Rish 67bf3a77c1 Updated price helper to output well formatted prices
refs https://github.com/TryGhost/Team/issues/472

The current `{{price}}` helper only works with `amount` to convert it into right value but doesn't allow any formatting with currency etc, leaving most of the work to theme.  We want to be able to output well formatted prices. E.g. the API returns 5000 for 5 EUR but we want to output €5.

The updated {{price}} helper can take a plan object or plan amount currency and use them to output a well formatted price. It works with JS's built in Intl.NumberFormat behaviour to return output in different formats, also allowing theme devs to override formatting with options.

Examples:

With Plan object => `{{price plan}} → "€5"`
With Plan object and custom number format =>  `{{price plan numberFormat="long"}} → "€5.00"`
Output only currency symbol =>  `{{price currency='EUR'}} → "€"`
2021-02-25 13:01:24 +05:30
..
test_tpl Updated {{content}} helper partial template name 2021-02-09 13:59:52 +05:30
asset_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
author_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
authors_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
body_class_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
cancel_link_spec.js Moved labs usage into cancel_link helper file 2020-04-08 19:31:55 +01:00
concat_spec.js Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00
content_spec.js Added paywall card to mark end of free content preview (#12663) 2021-02-17 23:00:26 +00:00
date_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
encode_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
excerpt_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
facebook_url_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
foreach_spec.js Fixed "no-shadow" eslint warning in tests 2020-10-19 17:45:26 +13:00
get_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
ghost_foot_spec.js Updated tests that were stubbing old ghost_head/ghost_foot settings keys 2020-07-01 17:58:12 +01:00
ghost_head_spec.js Updated twitter/og structured data rules 2021-02-05 18:50:11 +13:00
has_spec.js Fixed "no-shadow" eslint warning in tests 2020-10-19 17:45:26 +13:00
img_url_spec.js Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
is_spec.js Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
lang_spec.js Renamed settings keys from default_locale to lang 2020-06-24 14:07:24 +12:00
link_class_spec.js Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00
link_spec.js Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00
meta_description_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
meta_title_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
navigation_spec.js 🐛 Fixed logic error in navigation for isSecondary 2020-05-18 19:15:28 +01:00
next_post_spec.js Migrate the default api version from v2 to v3 2021-02-03 15:02:51 +01:00
page_url_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
pagination_spec.js Updated links to ghost.org sites 2021-01-20 09:59:45 +13:00
plural_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
post_class_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
prev_post_spec.js Migrate the default api version from v2 to v3 2021-02-03 15:02:51 +01:00
price_spec.js Updated price helper to output well formatted prices 2021-02-25 13:01:24 +05:30
raw_spec.js Added raw handlebars helper 2020-04-06 17:26:50 +01:00
reading_time_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
t_spec.js 🐛 Fixed incorrect locale loading when changing themes 2021-01-04 17:26:22 +13:00
tags_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
title_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
twitter_url_spec.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
url_spec.js Fixed "no-shadow" eslint warning in tests 2020-10-19 17:45:26 +13:00