IDEMSInternational / open-app-builder

PLH App Frontend
GNU General Public License v3.0
6 stars 25 forks source link

Test: template calc specs #2130

Open chrismclarke opened 11 months ago

chrismclarke commented 11 months ago

PR Checklist

TODO

Description

Initially I had hoped to setup a testing environment that would allow testing the plh_calc functions called from a templating context (e.g. @calc(plh_add_family_member(@local.families)), however I realised the current system isn't set up very well to support. I've added issue #2131 to suggest ways we might want to reconsider the calc system in the future.

So for now this PR only adds some simple spec tests and does not provide any more advanced e2e testing

Review Notes

yarn ng test --include src\app\shared\components\template\services\template-calc.spec.ts

Dev Notes

As discussed in recent conversations linked to #2080, this provides another example of using mocked services when testing methods of a service with dependencies (in case of interest). The mocks are quite minimal, and could be expanded as we add tests for other services that require additional functionality

Git Issues

Closes #

Screenshots/Videos

If useful, provide screenshot or capture to highlight main changes