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 3 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__poweredByLink" href="https://www.ons.gov.uk/">
<div class="ons-footer__poweredby 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
4 changes: 4 additions & 0 deletions src/components/footer/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@
margin-bottom: 0.5rem !important;
}
}

&__poweredByLink {
display: contents;
}
rmccar marked this conversation as resolved.
Show resolved Hide resolved
}
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__poweredByLink" {% if lang == "cy" %}href="https://cy.ons.gov.uk/"{% else %}href="https://www.ons.gov.uk/"{% endif %}>
<div class="ons-footer__poweredby ons-u-mb-m">
{{ onsLogo | safe }}
</div>
</a>
balibirchlee marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}
</div>
{% if params.crest %}
Expand Down
14 changes: 13 additions & 1 deletion src/components/footer/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ describe('macro: footer', () => {
it('renders expected column titles', () => {
const $ = cheerio.load(renderComponent('footer', params));

const titleHeadings = mapAll($('.ons-footer__heading'), node => node.text().trim());
const titleHeadings = mapAll($('.ons-footer__heading'), (node) => node.text().trim());
expect(titleHeadings).toEqual(['First column', 'Second column']);
});

Expand Down 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__poweredByLink').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__poweredByLink').attr('href')).toBe('https://www.ons.gov.uk/');
});
});
describe('provided poweredBy logo', () => {
describe.each([
[
Expand Down
Loading