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.
This commit is contained in:
Víctor Falcón 2026-07-04 20:35:21 +02:00
parent dff7d9b08f
commit 85d9d2444b
1 changed files with 7 additions and 0 deletions

View File

@ -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();