From 85d9d2444b3fd46ced98746debab397117956ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vi=CC=81ctor=20Falco=CC=81n?= Date: Sat, 4 Jul 2026 20:35:21 +0200 Subject: [PATCH] test(drip): assert promo code email injects the FOUNDER view var PromoCodeEmail is the only drip mail that adds extra view data, now via the contentData() hook. Nothing asserted the promoCode variable, so a regression in that hook would go unnoticed. Assert the rendered content data is exactly userName + promoCode => FOUNDER. --- tests/Feature/MailSenderTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/Feature/MailSenderTest.php b/tests/Feature/MailSenderTest.php index 678da3e0..788a2eff 100644 --- a/tests/Feature/MailSenderTest.php +++ b/tests/Feature/MailSenderTest.php @@ -117,6 +117,13 @@ test('only the paywall follow-up sets a reply-to, back to the drip sender', func expect((new WelcomeEmail($user))->envelope()->replyTo)->toBe([]); }); +test('promo code email adds the founder promo code to its view data', function () { + $user = User::factory()->create(); + + expect((new PromoCodeEmail($user))->content()->with) + ->toEqual(['userName' => $user->name, 'promoCode' => 'FOUNDER']); +}); + test('default sender is used for active non-drip mailables', function (string $mailableClass) { $user = User::factory()->create();