Skip to content

Commit

Permalink
Merge branch 'main' into fix/improve-modal-location
Browse files Browse the repository at this point in the history
  • Loading branch information
Lealefoulon authored Jan 7, 2025
2 parents 6a5d8bb + 1ef6e05 commit 1e8ee2a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/metabase_export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- name: Install Scalingo CLI
run: curl -O https://cli-dl.scalingo.com/install && bash install

Expand Down
12 changes: 6 additions & 6 deletions src/Infrastructure/Form/Regulation/VehicleSetFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
ChoiceType::class,
options : [
'choices' => [
3.5 => 3.5,
7.5 => 7.5,
19 => 19,
26 => 26,
32 => 32,
44 => 44,
'3.5' => 3.5,
'7.5' => 7.5,
'19' => 19,
'26' => 26,
'32' => 32,
'44' => 44,
],
'label' => 'regulation.vehicle_set.heavyweightMaxWeight',
'placeholder' => 'regulation.vehicle_set.heavyweightMaxWeight.placeholder',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,28 @@ public function testInvalidBlankCritairTypes(): void
$this->assertStringContainsString('Cette valeur ne doit pas être vide.', $crawler->filter('#measure_form_vehicleSet_critairTypes_error')->text());
}

public function testHeavyweightMaxWeightChoices(): void
{
$client = $this->login();
$crawler = $client->request('GET', '/_fragment/regulations/' . RegulationOrderRecordFixture::UUID_PERMANENT . '/measure/add');
$this->assertResponseStatusCodeSame(200);
$this->assertSecurityHeaders();

$choices = $crawler
->filter('select[name="measure_form[vehicleSet][heavyweightMaxWeight]"] > option')
->each(fn ($node) => [$node->attr('value'), $node->text()]);

$this->assertEquals([
['', 'Sélectionner le poids'],
['3.5', 3.5],
['7.5', 7.5],
['19', 19],
['26', 26],
['32', 32],
['44', 44],
], $choices);
}

public function testInvalidCritairTypes(): void
{
$client = $this->login();
Expand Down

0 comments on commit 1e8ee2a

Please sign in to comment.