Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/3004/icon in footer not clickable #3036

Merged
merged 15 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions __snapshots__/layout/_template.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1595,8 +1595,9 @@ exports[`base page template matches the full configuration snapshot 1`] = `
</div>


<div class="ons-footer__poweredby ons-u-mb-m">

<a class="ons-footer__poweredBy-link" href="https://www.ons.gov.uk/">
<div class="ons-footer__poweredby-logo ons-u-mb-m">

<svg class="ons-icon--logo" xmlns="http://www.w3.org/2000/svg" width="197" height="19" viewBox="33 2 552 60" aria-labelledby="ons-logo-en-footer-alt">
<title id="ons-logo-en-footer-alt">Office for National Statistics</title>
<g class="ons-icon--logo__group ons-icon--logo__group--secondary" fill="#a8bd3a">
Expand Down Expand Up @@ -1636,7 +1637,8 @@ exports[`base page template matches the full configuration snapshot 1`] = `
</g>
</svg>

</div>
</div>
</a>

</div>

Expand Down
8 changes: 8 additions & 0 deletions src/components/footer/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
vertical-align: middle;
}

&__poweredBy-link {
&:focus {
.ons-icon--logo {
@extend %a-focus;
}
}
}

.ons-icon--logo,
.ons-icon--logo__group {
fill: var(--ons-color-black) !important;
Expand Down
8 changes: 5 additions & 3 deletions src/components/footer/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@
</div>
{% endif %}
{% if not params.poweredBy %}
<div class="ons-footer__poweredby ons-u-mb-m">
{{ onsLogo | safe }}
</div>
<a class="ons-footer__poweredBy-link" {% if lang == "cy" %}href="https://cy.ons.gov.uk/"{% else %}href="https://www.ons.gov.uk/"{% endif %}>
<div class="ons-footer__poweredby-logo ons-u-mb-m">
{{ onsLogo | safe }}
</div>
</a>
{% endif %}
</div>
{% if params.crest %}
Expand Down
12 changes: 12 additions & 0 deletions src/components/footer/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,18 @@ describe('macro: footer', () => {
});
});
});
describe('correct link for language', () => {
it('has the Welsh lang link when the default Welsh lang ons icon is present', () => {
const $ = cheerio.load(renderComponent('footer', { lang: 'cy' }));

expect($('.ons-footer__poweredBy-link').attr('href')).toBe('https://cy.ons.gov.uk/');
});
it('has the English lang link when the default English lang ons icon is present', () => {
const $ = cheerio.load(renderComponent('footer', { lang: 'en' }));

expect($('.ons-footer__poweredBy-link').attr('href')).toBe('https://www.ons.gov.uk/');
});
});
describe('provided poweredBy logo', () => {
describe.each([
[
Expand Down
Loading