Skip to content

Commit

Permalink
UML-3318: back & cancel button for "check your answers" screen (#2674)
Browse files Browse the repository at this point in the history
* back and cancel buttons

* add behat tests for cancel and back buttons
  • Loading branch information
Lbagg1 authored Jun 25, 2024
1 parent 479d754 commit 11cce29
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
13 changes: 13 additions & 0 deletions service-front/app/features/actor-check-your-answers.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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$/
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public function handleGet(ServerRequestInterface $request): ResponseInterface
'user' => $this->user,
'form' => $this->form,
'data' => $data,
'back' => $this->lastPage($this->state($request)),
]
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
{% block content %}

<div class="govuk-width-container">
<main class="govuk-main-wrapper" id="main-content" role="main">
<div role="navigation" aria-labelledby="back-link-navigation">
<a href="{{ path(back) }}" class="govuk-back-link" id="back-link-navigation">
{% trans %}Back{% endtrans %}
</a>
</div>

<main class="govuk-main-wrapper" id="main-content" role="main">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-xl">{% trans %}Check your answers{% endtrans %}</h1>
Expand Down Expand Up @@ -90,6 +95,10 @@
{% trans %}Continue{% endtrans %}
</button>

<a href="{{ path("lpa.dashboard") }}" class="govuk-button govuk-button--secondary">
{% trans %}Cancel{% endtrans %}
</a>

{{ govuk_form_close() }}
</div>
</div>
Expand Down

0 comments on commit 11cce29

Please sign in to comment.