Closed eamon0989 closed 2 years ago
@eamon0989 The tests for for CoA v1.0.0 should be disabled (as the release v1.0.0 will not land right away) except the one using local resources, then for the latter you should update the PDF fixtures to make the test pass.
@eamon0989 The tests for for CoA v1.0.0 should be disabled (as the release v1.0.0 will not land right away) except the one using local resources, then for the latter you should update the PDF fixtures to make the test pass.
I've commented out the PDF test for now, the HTML test is passing so I've left it, if you want it removed let me know. SonarCloud is failing due to 0.0 percent coverage, but the tests are there, it doesn't seem to recognize the lines they cover for some reason.
SonarCloud Quality Gate failed.
Description
This PR fixes the issue found at https://github.com/thematerials-network/CoA-schemas/issues/57. It updates the functions
localizeValue
andlocalizeNumber
ingenerate-html
to allow values with trailing zeros to be passed in without any precision being lost by passing the value in as a string. I have also added unit tests to verify that there has been no regression and that the localization happens as expected.The helper
localizeValue
ingenerate-pdf-template-helpers
has also been updated to allow values with trailing zeros, and the tests have been updated. Updatecreate-html-certificate.ts
to handle partial maps and extra translations. Updatecreate-pdf-certificate.ts
to handle extra translations. Add CoA v1.0.0 fixtures and tests. UpdateschemaTypes.ts
to latest version. Update CoA PDF generator to handle theStreet
property. Update CoA PDF tests to use the latest certificate, update helpers to allowextraTranslations
to be loaded for the tests. Update CoA v1.0.0 valid_cert to include properties needed for the CoA PDF tests, update fixtures. Update README to make it clearer how to handleschemaTypes.ts
.Fixes #174 fixes thematerials-network/CoA-schemas#59
Type of change
Checklist:
Screenshot showing updated rendering for https://github.com/thematerials-network/CoA-schemas/issues/59
Screenshot showing a PDF rendered without the
Analysis
property: