Forgot password flow

This commit is contained in:
2026-07-27 09:43:00 -03:00
parent 7b565e7fa7
commit c37b8894e4
23 changed files with 1095 additions and 0 deletions

View File

@@ -80,6 +80,29 @@ class NotificationMailServiceTest extends TestCase
});
}
public function test_it_sends_a_branded_password_reset_email(): void
{
$attempt = $this->user->resetPasswordAttempts()->create([
'codigo' => '0123',
]);
app(NotificationMailService::class)->sendPasswordResetCode(
$attempt->id,
$this->tenant->codigo,
);
Mail::assertSent(Mailable::class, function (Mailable $mail): bool {
$mail->assertTo('ada@example.com');
$mail->assertHasSubject('Código para recuperar tu contraseña - Mail Tenant');
$rendered = $mail->render();
return str_contains($rendered, '0123')
&& str_contains($rendered, 'Ada Lovelace')
&& str_contains($rendered, 'Mail Tenant')
&& str_contains($rendered, '#112233');
});
}
public function test_it_sends_purchase_and_ticket_emails_to_the_purchase_recipient(): void
{
$purchase = Purchase::query()->create([