Move back link outside of main where it was used in the page header

The page_header macro includes an optional back link. Since the
page_header is always used inside `<main>`, where the back link should
not be, this stops setting the back link in the page header and instead
sets it in the new `backLink` block.
This commit is contained in:
Katie Smith
2021-07-30 18:23:12 +01:00
parent 1860b2b690
commit 0f0b8b8ae4
120 changed files with 773 additions and 538 deletions

View File

@@ -1550,8 +1550,7 @@ def test_send_one_off_offers_link_to_upload(
template_id=fake_uuid,
_follow_redirects=True,
)
back_link = page.select('main a')[0]
back_link = page.select_one('.govuk-back-link')
link = page.select_one('form a')
assert back_link.text.strip() == 'Back'
@@ -1662,8 +1661,8 @@ def test_link_to_upload_not_offered_when_entering_personalisation(
# Were entering personalisation
assert page.select_one('input[type=text]')['name'] == 'placeholder_value'
assert page.select_one('label[for=placeholder_value]').text.strip() == 'name'
# …but first link on the page is Back, so not preceeded by Upload
assert page.select_one('main a').text == 'Back'
# No Upload link shown
assert len(page.select('main a')) == 0
assert 'Upload' not in page.select_one('main').text