fix: enable bookings without ski passes
This commit is contained in:
@@ -9,7 +9,9 @@ use App\BusProNet\Model\Travel;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Form\Model\ParticipantDto;
|
||||
use App\Form\Service\CreateFieldStateProvider;
|
||||
use App\Form\Service\ServiceAgeEvaluator;
|
||||
use App\Service\ParticipantEligibilityChecker;
|
||||
use App\Service\ServiceAvailabilityCalculator;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@@ -24,7 +26,10 @@ class CreateFieldStateProviderTest extends TestCase
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->provider = new CreateFieldStateProvider(new ParticipantEligibilityChecker());
|
||||
$this->provider = new CreateFieldStateProvider(new ParticipantEligibilityChecker(
|
||||
new ServiceAgeEvaluator(),
|
||||
new ServiceAvailabilityCalculator()
|
||||
));
|
||||
}
|
||||
|
||||
public function testDependentInsuranceFieldHidesWhenApplicantSelectsFamilyInsuranceThenReappearsAfterSwitch(): void
|
||||
|
||||
@@ -134,6 +134,17 @@ class ParticipantFieldOptionsProviderSkiPassAvailabilityTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testTravelWithoutSkiPassesRendersNoField(): void
|
||||
{
|
||||
$bookingDto = $this->createBookingDto([]);
|
||||
|
||||
$this->assertSame(
|
||||
[],
|
||||
$this->provider->getFieldOptions('skiPass', $bookingDto, 0),
|
||||
'The field has to be absent entirely, not rendered with an empty choice list'
|
||||
);
|
||||
}
|
||||
|
||||
/** @return int[] */
|
||||
private function getSkiPassChoiceIds(BookingDto $bookingDto): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user