Skip to content

Commit

Permalink
Fix/3004/icon in footer not clickable (#3036)
Browse files Browse the repository at this point in the history
  • Loading branch information
balibirchlee authored and rmccar committed Mar 6, 2024
1 parent 03516e9 commit 316b964
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
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

0 comments on commit 316b964

Please sign in to comment.