From 59dbf88dc8938f0e77af2b94518da0be1f087370 Mon Sep 17 00:00:00 2001 From: Jason Bruce Jones Date: Sat, 9 May 2026 20:02:49 -0400 Subject: [PATCH] test(email-templates): align token assertions with current dot-notation 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) --- .../EmailTemplates/EmailTemplateTokenTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/tests/Feature/Http/Actions/EmailTemplates/EmailTemplateTokenTest.php b/backend/tests/Feature/Http/Actions/EmailTemplates/EmailTemplateTokenTest.php index 030a2f06f5..4689b16594 100644 --- a/backend/tests/Feature/Http/Actions/EmailTemplates/EmailTemplateTokenTest.php +++ b/backend/tests/Feature/Http/Actions/EmailTemplates/EmailTemplateTokenTest.php @@ -68,11 +68,11 @@ public function test_can_get_order_confirmation_tokens(): void $tokens = $response->json('tokens'); $this->assertNotEmpty($tokens); - $firstNameToken = collect($tokens)->firstWhere('token', '{{ order_first_name }}'); + $firstNameToken = collect($tokens)->firstWhere('token', '{{ order.first_name }}'); $this->assertNotNull($firstNameToken); $this->assertEquals('The first name of the person who placed the order', $firstNameToken['description']); - $lastNameToken = collect($tokens)->firstWhere('token', '{{ order_last_name }}'); + $lastNameToken = collect($tokens)->firstWhere('token', '{{ order.last_name }}'); $this->assertNotNull($lastNameToken); $this->assertEquals('The last name of the person who placed the order', $lastNameToken['description']); } @@ -97,7 +97,7 @@ public function test_can_get_attendee_ticket_tokens(): void $tokens = $response->json('tokens'); $this->assertNotEmpty($tokens); - $attendeeNameToken = collect($tokens)->firstWhere('token', '{{ attendee_name }}'); + $attendeeNameToken = collect($tokens)->firstWhere('token', '{{ attendee.name }}'); $this->assertNotNull($attendeeNameToken); } @@ -128,10 +128,10 @@ public function test_tokens_include_order_specific_tokens(): void $tokens = $response->json('tokens'); $tokenNames = collect($tokens)->pluck('token')->toArray(); - $this->assertContains('{{ event_title }}', $tokenNames); - $this->assertContains('{{ order_number }}', $tokenNames); - $this->assertContains('{{ order_total }}', $tokenNames); - $this->assertContains('{{ organizer_name }}', $tokenNames); + $this->assertContains('{{ event.title }}', $tokenNames); + $this->assertContains('{{ order.number }}', $tokenNames); + $this->assertContains('{{ order.total }}', $tokenNames); + $this->assertContains('{{ organizer.name }}', $tokenNames); } public function test_tokens_have_proper_structure(): void