generated from nationalarchives/da-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from nationalarchives/AYR-390/footer-component
Ayr 390/footer component
- Loading branch information
Showing
6 changed files
with
211 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
|
||
/* CSS for Footer */ | ||
|
||
|
||
.govuk-footer { | ||
padding-bottom: 40px; | ||
} | ||
|
||
.govuk-footer__tna-logo { | ||
width: 100px; | ||
} | ||
|
||
.govuk-footer__meta { | ||
margin: 0; | ||
align-items: center; | ||
gap: 40px; | ||
} | ||
|
||
.govuk-footer__meta-item { | ||
display: block; | ||
margin: 0; | ||
} | ||
|
||
.govuk-footer__inline-list-item { | ||
margin-bottom: 10px; | ||
} | ||
|
||
@media screen and (max-width: 640px) { | ||
.govuk-footer__meta { | ||
flex-direction: column; | ||
} | ||
|
||
.govuk-footer__link { | ||
order: 2; | ||
} | ||
.govuk-footer__meta-item--grow { | ||
flex-basis: auto; | ||
} | ||
|
||
.govuk-footer__inline-list-item { | ||
display:block; | ||
margin-right: 0; | ||
margin-bottom: 0; | ||
text-align:center; | ||
padding: 10px 0; | ||
} | ||
|
||
.govuk-footer__licence-logo{ | ||
margin:0 auto 10px; | ||
display:block; | ||
} | ||
|
||
.govuk-footer__licence-description { | ||
text-align: center; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% extends "base.html" %} | ||
|
||
|
||
{%- from 'govuk_frontend_jinja/components/back-link/macro.html' import govukBackLink -%} | ||
|
||
{% block pageTitle %}Terms of use – {{config['SERVICE_NAME']}} – GOV.UK{% endblock %} | ||
|
||
{% block beforeContent %} | ||
{{ super() }} | ||
{{ govukBackLink({ | ||
'text': "Back", | ||
'href': url_for('main.index') | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
{{ super() }} | ||
<h1 class="govuk-heading-xl">Terms of use</h1> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import pytest | ||
from playwright.sync_api import Page, expect | ||
|
||
# Define list of footer links and their expected URLS | ||
|
||
footer_links = [ | ||
( | ||
"Terms of use", | ||
"/terms-of-use", | ||
"Terms of use – AYR - Access Your Records – GOV.UK ", | ||
), | ||
( | ||
"Privacy", | ||
"/privacy", | ||
"Privacy notice – AYR - Access Your Records – GOV.UK ", | ||
), | ||
( | ||
"Cookies policy", | ||
"/cookies", | ||
"Cookies – AYR - Access Your Records – GOV.UK", | ||
), | ||
( | ||
"Accessibility", | ||
"/accessibility", | ||
"Accessibility statement – AYR - Access Your Records – GOV.UK", | ||
), | ||
] | ||
|
||
|
||
@pytest.fixture | ||
def setup_page(page: Page): | ||
page.goto("/") | ||
yield page | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"link_text, expected_url, expected_title", footer_links | ||
) | ||
def test_footer_links(setup_page, link_text, expected_url, expected_title): | ||
# locate and click footer link as user would | ||
|
||
setup_page.click(f'text="{link_text}"') | ||
|
||
# Wait for navigation and check URL is correct | ||
|
||
setup_page.wait_for_url(expected_url, timeout=5000) | ||
|
||
# Assertions | ||
|
||
# Check if the text of the link is contained within title of the page | ||
|
||
expect(setup_page).to_have_title(expected_title) |