Ghost/test/utils/fixtures/themes
Fabien 'egg' O'Carroll d19452147d
🐛 Fixed @price template data to work with price helper (#12764)
closes https://github.com/TryGhost/Team/issues/545

The price helper requires an object with amount & currency properties to
work correctly. This updates the @price data object to expose these.

In order to maintain backward compatibility with using the @price data
as primitive number values, we add a valueOf method which returns the
legacy dollar amount value.

This means you can use {{price @price.monthly}} OR
{{@price.monthly}} - the second of which will output the dollar
amount.

A new theme fixture was added to test both usages of the @price data
2021-03-18 16:13:10 +00:00
..
broken-theme Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00
casper Updated links to ghost.org sites 2021-01-20 09:59:45 +13:00
casper-1.4 Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00
price-data-test-theme 🐛 Fixed @price template data to work with price helper (#12764) 2021-03-18 16:13:10 +00:00
test-theme Updated fixture for test theme to use @site 2021-03-04 01:09:54 +05:30
test-theme-channels Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00
casper.zip Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00
invalid.zip Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00
README.md Bumped gscan to 4.0.0-pre.5 2021-03-04 21:18:27 +13:00
valid.zip Bumped gscan to 4.0.0-pre.5 2021-03-04 21:18:27 +13:00
warnings.zip Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00

Modifying theme fixtures

When a new rule is introduced in gscan one of these fixture files might break and you'll have to update a "zip" which isn't as easy as opening a text editor... It could become that one day but for now here are some commands to help out with the edit process

  • Unzip the theme files, e.g.: cd $CURRENT_DIR && unzip valid.zip -d valid
  • Make a change in the file which caused a warning/error/whatever
  • Zip the files back: zip -r valid.zip ./valid
  • Commit changed zip file: git add valid.zip ;... you know the drill :)

Ideas for future improvements in theme tests:

  • Decouple tests from file system as much as possible
  • Track contents of what is in "zips" in source control. Right now, having a diff on a binary file is not useful at all