Skip to content

Commit

Permalink
fix: restore "No (Operator to post)" radio for internal caseworker fo…
Browse files Browse the repository at this point in the history
…rm. (#338)
  • Loading branch information
fibble authored Sep 19, 2024
1 parent 6b46419 commit bdd53bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public function alterForm(Form $form, array $params)
$advertisements = $form->get('advertisements');
$advertisements->setLabel('application_operating-centres_authorisation-sub-action.advertisements.adPlaced');

$adPlaced = $advertisements->get('radio');

// Add operator to post option back in just for caseworker form: https://dvsa.atlassian.net/browse/VOL-5814
$valueOptions = $adPlaced->getValueOptions();
$valueOptions['adSendByPost'] = 'No (operator to post)';
$adPlaced->setValueOptions($valueOptions);

$form->get('data')->get('guidance')->setValue('lva-operating-centre-newspaper-advert');
$form->get('data')->get('permission')->setLabel('');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@ public function testAlterForm($appliedVia)
m::mock(ElementInterface::class)
->shouldReceive('getValueOptions')
->andReturn(['foo' => 'bar', OperatingCentreMapper::VALUE_OPTION_AD_UPLOAD_LATER => 'cake'])
->once()
->twice()
->shouldReceive('setValueOptions')
->with(['foo' => 'bar'])
->once()
->shouldReceive('setValueOptions')
->with([
'foo' => 'bar',
'adPlacedLater' => 'cake',
'adSendByPost' => 'No (operator to post)'
])
->once()
->getMock()
)
->once()
->twice()
->shouldReceive('setLabel')
->with('application_operating-centres_authorisation-sub-action.advertisements.adPlaced')
->once()
Expand Down

0 comments on commit bdd53bf

Please sign in to comment.