Skip to content

test(email-templates): align token assertions with current dot-notation tokens 🤖#1190

Open
mrjbj wants to merge 1 commit intoHiEventsDev:developfrom
mrjbj:fix/email-template-token-test-assertions
Open

test(email-templates): align token assertions with current dot-notation tokens 🤖#1190
mrjbj wants to merge 1 commit intoHiEventsDev:developfrom
mrjbj:fix/email-template-token-test-assertions

Conversation

@mrjbj
Copy link
Copy Markdown
Contributor

@mrjbj mrjbj commented May 10, 2026

What changes I've made

AI noticed that certain tests were failing on develop branch due to code refactoring from snake_case to dot.notaion in EmailTemplageTokenTest This patch updates those tests.

EmailTemplateTokenTest asserts old underscore-style token names ({{ order_first_name }}, {{ attendee_name }}, {{ event_title }}, {{ order_number }}, {{ order_total }}, {{ organizer_name }}, {{ order_last_name }}) but
LiquidTemplateRenderer::getAvailableTokens has been emitting dot-notation tokens ({{ order.first_name }}, {{ attendee.name }}, {{ event.title }}, etc.) since the format was refactored. The test was never updated, so 3 of its 6 cases have been failing
on develop for a while:

  • test_can_get_order_confirmation_tokens (asserts {{ order_first_name }} exists)
  • test_can_get_attendee_ticket_tokens (asserts {{ attendee_name }} exists)
  • test_tokens_include_order_specific_tokens (asserts {{ event_title }} etc. exist)

This PR updates the assertions to match the actual emitted tokens. No production code change — purely test alignment.

How I've tested these changes

  • php artisan test --filter=EmailTemplateTokenTest — 6 passed (was 3 failed)

Checklist

  • I have read the contributing guidelines.
  • My code follows the coding standards of the project.
  • I have tested my changes, and they work as expected.
  • I understand that this PR will be closed if I do not follow the contributor guidelines and if this PR template is left unedited.

…on tokens

EmailTemplateTokenTest asserts old underscore-style token names
({{ order_first_name }}, {{ attendee_name }}, {{ event_title }}, etc.)
but LiquidTemplateRenderer::getAvailableTokens has emitted dot-notation
tokens ({{ order.first_name }}, {{ attendee.name }}, {{ event.title }})
since the token format was refactored. The test was never updated, so
3 of its 6 cases have been failing on develop.

Update assertions to match the actual emitted tokens. No production
code change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant