From 4f1c02acac1d9bcc4a48f0db67b8d8832ee61d56 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Tue, 23 Apr 2024 23:01:27 +0200 Subject: [PATCH] Add test for blocks --- tests/Feature/Form/FormRegisterMailTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/Feature/Form/FormRegisterMailTest.php b/tests/Feature/Form/FormRegisterMailTest.php index cdcde559..9d7b45e3 100644 --- a/tests/Feature/Form/FormRegisterMailTest.php +++ b/tests/Feature/Form/FormRegisterMailTest.php @@ -238,4 +238,22 @@ class FormRegisterMailTest extends FormTestCase $mail->assertDontSeeInText('::content::'); } } + + public function testItSendsEmailWhenMailTopIsEmpty(): void + { + $this->login()->loginNami()->withoutExceptionHandling(); + + $participant = Participant::factory()->for( + Form::factory() + ->fields([ + $this->textField('firstname')->specialType(SpecialType::FIRSTNAME), + $this->textField('lastname')->specialType(SpecialType::LASTNAME), + ])->state(['mail_top' => []]) + ) + ->data(['firstname' => 'Max', 'lastname' => 'Muster']) + ->create(); + + $mail = new ConfirmRegistrationMail($participant); + $mail->assertSeeInText('Max'); + } }