Add test for blocks

This commit is contained in:
philipp lang 2024-04-23 23:01:27 +02:00
parent ae39c8dd31
commit 4f1c02acac
1 changed files with 18 additions and 0 deletions

View File

@ -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');
}
}