fix: prevent generating offer links while booking is in draft
This commit is contained in:
@@ -72,6 +72,23 @@ class AccommodationBookingTest extends TestCase
|
||||
self::assertSame('Buchung', $accepted->recordLabel());
|
||||
}
|
||||
|
||||
public function testADraftIsTheOnlyStatusTheCustomerMustNotReach(): void
|
||||
{
|
||||
// Entwurf is the office's own workbench — nothing has been offered yet, so there is
|
||||
// nothing an access link could show. Whether a link that exists still opens anything
|
||||
// is a separate question the offer page answers (a discarded booking does not).
|
||||
foreach (AccommodationBookingStatus::cases() as $status) {
|
||||
$booking = new AccommodationBooking();
|
||||
$booking->setStatus($status);
|
||||
|
||||
self::assertSame(
|
||||
AccommodationBookingStatus::Draft !== $status,
|
||||
$booking->isCustomerAccessible(),
|
||||
$status->value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function testTheLabelIsIndependentOfWhereTheBookingCameFrom(): void
|
||||
{
|
||||
// Origin answers "how did this come about" and is deliberately not the same
|
||||
|
||||
Reference in New Issue
Block a user