diff --git a/service-front/app/features/actor-check-your-answers.feature b/service-front/app/features/actor-check-your-answers.feature index c06c9e9439..5dee9a31cb 100644 --- a/service-front/app/features/actor-check-your-answers.feature +++ b/service-front/app/features/actor-check-your-answers.feature @@ -36,3 +36,16 @@ Feature: Check your answers before requesting an activation key When I request to go back and change my postcode Then I am taken back to the postcode page where I can see my answers and change them Then I press continue and I am taken back to the check answers page + + @ui + Scenario: The user can go back and change their entered postcode + Given I have requested an activation key with valid details + When I request to go back + Then I am taken back to the postcode page where I can see my answers and change them + Then I press continue and I am taken back to the check answers page + + @ui + Scenario: The user can go back and change their entered postcode + Given I have requested an activation key with valid details + When I press cancel + Then I am taken back to the dashboard page diff --git a/service-front/app/features/context/UI/RequestActivationKeyContext.php b/service-front/app/features/context/UI/RequestActivationKeyContext.php index 93d71b546b..0c48721fc2 100644 --- a/service-front/app/features/context/UI/RequestActivationKeyContext.php +++ b/service-front/app/features/context/UI/RequestActivationKeyContext.php @@ -1298,6 +1298,23 @@ public function iRequestToGoBackAndChangeMyPostcode() $this->ui->clickLink('change-postcode'); } + /** + * @When /^I request to go back$/ + */ + public function iRequestToGoBack() + { + $this->ui->clickLink('Back'); + } + + /** + * @When /^I press cancel/ + */ + public function iPressCancel() + { + $this->ui->clickLink('Cancel'); + } + + /** * @When /^I select that I cannot take calls$/ */ diff --git a/service-front/app/src/Actor/src/Handler/RequestActivationKey/CheckYourAnswersHandler.php b/service-front/app/src/Actor/src/Handler/RequestActivationKey/CheckYourAnswersHandler.php index 2ad5224b9c..df76ca81af 100644 --- a/service-front/app/src/Actor/src/Handler/RequestActivationKey/CheckYourAnswersHandler.php +++ b/service-front/app/src/Actor/src/Handler/RequestActivationKey/CheckYourAnswersHandler.php @@ -109,6 +109,7 @@ public function handleGet(ServerRequestInterface $request): ResponseInterface 'user' => $this->user, 'form' => $this->form, 'data' => $data, + 'back' => $this->lastPage($this->state($request)), ] )); } diff --git a/service-front/app/src/Actor/templates/actor/check-your-answers.html.twig b/service-front/app/src/Actor/templates/actor/check-your-answers.html.twig index 5a922b9bcd..bc99ba80c2 100644 --- a/service-front/app/src/Actor/templates/actor/check-your-answers.html.twig +++ b/service-front/app/src/Actor/templates/actor/check-your-answers.html.twig @@ -5,8 +5,13 @@ {% block content %}