Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(email-plugin): Allow currencies with formatMoney helper #2531

Conversation

StampixSMO
Copy link
Contributor

@StampixSMO StampixSMO commented Nov 17, 2023

Description

Added 2 new parameters to the formatMoney helper: currency and locale

Closes #2530

Breaking changes

Does this PR include any breaking changes we should be aware of?
No

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

⚡ Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

@StampixSMO
Copy link
Contributor Author

MacOS CI failing doesn't look to be related to this PR

@michaelbromley
Copy link
Member

Thanks, this is a long-overdue feature!

Everything looks good - nice work on the docs and tests 👍

I think it would also make sense to update the default order confirmation template to use the correct currencyCode too. Would you like to include that in this PR too?

@StampixSMO
Copy link
Contributor Author

StampixSMO commented Nov 20, 2023

I think it would also make sense to update the default order confirmation template to use the correct currencyCode too. Would you like to include that in this PR too?

Yep, missed that. Done!

Edit: Any idea why that unit test is failing?

@michaelbromley
Copy link
Member

The test output indicates that the onSend mock function is not being called as expected for some reason. This part:

onSend.mock.calls[0][0].body

means "the first argument of the first call to onSend".

@StampixSMO
Copy link
Contributor Author

The test output indicates that the onSend mock function is not being called as expected for some reason. This part:

onSend.mock.calls[0][0].body

means "the first argument of the first call to onSend".

Yep, my bad, I thought that issue was not due to my changes but it definitely was. The helper function threw an error and that was silently failing. All good now!

@StampixSMO
Copy link
Contributor Author

The test output indicates that the onSend mock function is not being called as expected for some reason. This part:

onSend.mock.calls[0][0].body

means "the first argument of the first call to onSend".

Yep, my bad, I thought that issue was not due to my changes but it definitely was. The helper function threw an error and that was silently failing. All good now!

E2E tests seem to throw Error: listen EADDRINUSE: address already in use :::3012, which I'm pretty sure is not related to this PR?

@michaelbromley
Copy link
Member

EADDRINUSE: address already in use :::3012

Yes that's just an intermittent flakiness of the e2e tests when 2 test suites running in parallel try to listen on the same port. This all looks good now, thanks for your contribution!

@michaelbromley michaelbromley merged commit ccf17fb into vendure-ecommerce:minor Nov 20, 2023
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants