fix: remind house managers of their own pending list at the teamer reminder pace
This commit is contained in:
1 parent
ab6ffd4eda
commit
77d7000df3
11 files changed
+515
-73
No files matched your search
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Email;
|
||||
|
||||
use App\Entity\Destination;
|
||||
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Mime\BodyRendererInterface;
|
||||
|
||||
/**
|
||||
* The house manager reminder has to say what is pending - it used to be a bare headline.
|
||||
*/
|
||||
class ReminderPendingFeedbackTemplateTest extends KernelTestCase
|
||||
{
|
||||
public function testItListsEachTravelWithWhatIsOpen(): void
|
||||
{
|
||||
$destination = (new Destination())
|
||||
->setProduct('Davos Klosters')
|
||||
->setHotel('Schwendi')
|
||||
->setDateFrom(new \DateTimeImmutable('2026-11-06'))
|
||||
->setDateTo(new \DateTimeImmutable('2026-11-13'))
|
||||
;
|
||||
|
||||
// rendered the way the mailer does, which also hands the layout its "email" variable
|
||||
$email = (new TemplatedEmail())
|
||||
->htmlTemplate('email/reminder_pending_feedback.html.twig')
|
||||
->context(['travels' => [
|
||||
['destination' => $destination, 'questionnaire' => 'draft', 'openRatings' => 2],
|
||||
]])
|
||||
;
|
||||
self::getContainer()->get(BodyRendererInterface::class)->render($email);
|
||||
$html = (string) $email->getHtmlBody();
|
||||
|
||||
$this->assertStringContainsString('06.11.2026 - 13.11.2026, Davos Klosters (Schwendi)', $html);
|
||||
$this->assertStringContainsString('Fragebogen als Entwurf gespeichert, noch nicht abgeschickt', $html);
|
||||
$this->assertStringContainsString('2 Teamer:innen noch nicht bewertet', $html);
|
||||
$this->assertStringContainsString('/house-manager/pending-feedback', $html);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user