diff --git a/src/components/footer/_macro.spec.js b/src/components/footer/_macro.spec.js
index d96dfdbc78..f04a033e25 100644
--- a/src/components/footer/_macro.spec.js
+++ b/src/components/footer/_macro.spec.js
@@ -354,8 +354,8 @@ describe('macro: footer', () => {
});
});
- describe('poweredBy logo', () => {
- describe('default poweredBy logo', () => {
+ describe('Footer logo', () => {
+ describe('default footer logo', () => {
describe.each([
[
'the `lang` parameter is not provided',
@@ -387,7 +387,7 @@ describe('macro: footer', () => {
});
});
});
- describe('provided poweredBy logo', () => {
+ describe('provided footer logo', () => {
describe.each([
[
'the `lang` parameter is "cy"',
@@ -415,54 +415,74 @@ describe('macro: footer', () => {
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/');
+ expect($('.ons-footer__logo-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/');
+ expect($('.ons-footer__logo-link').attr('href')).toBe('https://www.ons.gov.uk/');
});
});
- describe('provided poweredBy logo', () => {
+ describe('provided footer logo', () => {
describe.each([
[
- 'the `poweredBy` and `OGLLink` parameters are provided',
+ 'the `footerLogo` and `OGLLink` parameters are provided',
{
- poweredBy: '

',
+ footerLogo: {
+ logos: {
+ logo1: { logoImage: '

' },
+ },
+ },
OGLLink: EXAMPLE_OGL_LINK_PARAM,
},
],
[
- 'the `poweredBy` and `legal` parameters are provided',
+ 'the `footerLogo` and `legal` parameters are provided',
{
- poweredBy: '

',
+ footerLogo: {
+ logos: {
+ logo1: { logoImage: '

' },
+ },
+ },
legal: EXAMPLE_LEGAL_PARAM,
},
],
[
- 'the `poweredBy` and `crest` parameters are provided',
+ 'the `footerLogo` and `crest` parameters are provided',
{
- poweredBy: '

',
+ footerLogo: {
+ logos: {
+ logo1: { logoImage: '

' },
+ },
+ },
crest: true,
},
],
[
- 'the `poweredBy`, `legal` and `crest` parameters are provided',
+ 'the `footerLogo`, `legal` and `crest` parameters are provided',
{
- poweredBy: '

',
+ footerLogo: {
+ logos: {
+ logo1: { logoImage: '

' },
+ },
+ },
legal: EXAMPLE_LEGAL_PARAM,
crest: true,
},
],
[
- 'the `poweredBy` parameter is provided but the `legal` and `crest` parameters are not provided',
+ 'the `footerLogo` parameter is provided but the `legal` and `crest` parameters are not provided',
{
- poweredBy: '

',
+ footerLogo: {
+ logos: {
+ logo1: { logoImage: '

' },
+ },
+ },
},
],
- ])('where %s', (_, poweredByParams) => {
+ ])('where %s', (_, footerLogoParams) => {
const params = {
- ...poweredByParams,
+ ...footerLogoParams,
};
it('passes jest-axe checks', async () => {
@@ -478,6 +498,48 @@ describe('macro: footer', () => {
expect($('.custom-logo').length).toBe(1);
});
});
+
+ it('has the extra footer logo image and link', () => {
+ const $ = cheerio.load(
+ renderComponent('footer', {
+ footerLogo: {
+ logos: {
+ logo1: { logoImage: '

' },
+ logo2: {
+ logoUrl: '#0',
+ logoImage: '

',
+ },
+ },
+ },
+ legal: EXAMPLE_LEGAL_PARAM,
+ crest: true,
+ }),
+ );
+
+ expect($('.ons-footer__logo-link').attr('href')).toBe('#0');
+ expect($('.ons-footer__logo-link > img').attr('src')).toBe('a-logo.svg');
+ });
+
+ it('has the correct class applied for opposite display of logos', () => {
+ const $ = cheerio.load(
+ renderComponent('footer', {
+ footerLogo: {
+ logos: {
+ logo1: { logoImage: '

' },
+ logo2: {
+ logoUrl: '#0',
+ logoImage: '

',
+ },
+ },
+ display: 'split',
+ },
+ legal: EXAMPLE_LEGAL_PARAM,
+ crest: true,
+ }),
+ );
+
+ expect($('.ons-footer__logo-container').attr('class')).toContain('ons-grid-flex--between');
+ });
});
});
diff --git a/src/components/footer/example-footer-with-alternative-organisation.njk b/src/components/footer/example-footer-with-alternative-organisation.njk
index a6a51da7f4..831ea367a3 100644
--- a/src/components/footer/example-footer-with-alternative-organisation.njk
+++ b/src/components/footer/example-footer-with-alternative-organisation.njk
@@ -5,99 +5,104 @@
{% from "components/footer/_macro.njk" import onsFooter %}
{{
onsFooter({
- "poweredBy": '
',
+ "footerLogo": {
+ "logos": {
+ "logo1": {
+ "logoImage": '
'
+ }
+ }
+ },
"legal": [
{
"itemsList": [
diff --git a/src/components/footer/example-footer-with-multiple-logos-and-split-display.njk b/src/components/footer/example-footer-with-multiple-logos-and-split-display.njk
new file mode 100644
index 0000000000..7da0fb6e1e
--- /dev/null
+++ b/src/components/footer/example-footer-with-multiple-logos-and-split-display.njk
@@ -0,0 +1,173 @@
+---
+'fullWidth': true
+---
+
+{% from "components/footer/_macro.njk" import onsFooter %}
+{{
+ onsFooter({
+ "cols": [
+ {
+ "title": 'Business surveys',
+ "itemsList": [
+ {
+ "text": 'About our surveys',
+ "url": '#0'
+ },
+ {
+ "text": 'Lists of all surveys',
+ "url": '#0'
+ },
+ {
+ "text": 'Respondent Charter',
+ "url": '#0'
+ }
+ ]
+ },
+ {
+ "title": 'About ONS',
+ "itemsList": [
+ {
+ "text": 'What we do',
+ "url": '#0'
+ },
+ {
+ "text": 'Transparency and governance',
+ "url": '#0'
+ },
+ {
+ "text": 'Contact us',
+ "url": '#0'
+ }
+ ]
+ },
+ {
+ "title": 'Statistics',
+ "itemsList": [
+ {
+ "text": 'UK Statistics Authority',
+ "external": true,
+ "url": '#0'
+ },
+ {
+ "text": 'Release calendar',
+ "url": '#0'
+ },
+ {
+ "text": 'News',
+ "url": '#0'
+ }
+ ]
+ }
+ ],
+ "legal": [
+ {
+ "itemsList": [
+ {
+ "text": 'Cookies',
+ "url": '#0'
+ },
+ {
+ "text": 'Accessibility statement',
+ "url": '#0'
+ },
+ {
+ "text": 'Privacy and data protection',
+ "url": '#0'
+ },
+ {
+ "text": 'Terms and conditions',
+ "url": '#0'
+ }
+ ]
+ }
+ ],
+ "footerLogo": {
+ "logos": {
+ "logo2": {
+ "logoImage": '
',
+ "logoUrl": "#0"
+ }
+ },
+ "display": "split"
+ },
+ "OGLLink": true
+ })
+}}
diff --git a/src/components/footer/example-footer-with-multiple-logos.njk b/src/components/footer/example-footer-with-multiple-logos.njk
new file mode 100644
index 0000000000..db22c69cd8
--- /dev/null
+++ b/src/components/footer/example-footer-with-multiple-logos.njk
@@ -0,0 +1,171 @@
+---
+'fullWidth': true
+---
+
+{% from "components/footer/_macro.njk" import onsFooter %}
+{{
+ onsFooter({
+ "cols": [
+ {
+ "title": 'Business surveys',
+ "itemsList": [
+ {
+ "text": 'About our surveys',
+ "url": '#0'
+ },
+ {
+ "text": 'Lists of all surveys',
+ "url": '#0'
+ },
+ {
+ "text": 'Respondent Charter',
+ "url": '#0'
+ }
+ ]
+ },
+ {
+ "title": 'About ONS',
+ "itemsList": [
+ {
+ "text": 'What we do',
+ "url": '#0'
+ },
+ {
+ "text": 'Transparency and governance',
+ "url": '#0'
+ },
+ {
+ "text": 'Contact us',
+ "url": '#0'
+ }
+ ]
+ },
+ {
+ "title": 'Statistics',
+ "itemsList": [
+ {
+ "text": 'UK Statistics Authority',
+ "external": true,
+ "url": '#0'
+ },
+ {
+ "text": 'Release calendar',
+ "url": '#0'
+ },
+ {
+ "text": 'News',
+ "url": '#0'
+ }
+ ]
+ }
+ ],
+ "legal": [
+ {
+ "itemsList": [
+ {
+ "text": 'Cookies',
+ "url": '#0'
+ },
+ {
+ "text": 'Accessibility statement',
+ "url": '#0'
+ },
+ {
+ "text": 'Privacy and data protection',
+ "url": '#0'
+ },
+ {
+ "text": 'Terms and conditions',
+ "url": '#0'
+ }
+ ]
+ }
+ ],
+ "footerLogo": {
+ "logos": {
+ "logo2": {
+ "logoImage": '
'
+ }
+ }
+ },
+ "OGLLink": true
+ })
+}}
diff --git a/src/layout/_template.njk b/src/layout/_template.njk
index d6b2e03a32..2526878dca 100644
--- a/src/layout/_template.njk
+++ b/src/layout/_template.njk
@@ -206,7 +206,7 @@
"lang": currentLanguageISOCode,
"rows": pageConfig.footer.rows,
"cols": pageConfig.footer.cols,
- "poweredBy": pageConfig.footer.poweredBy,
+ "footerLogo": pageConfig.footer.footerLogo,
"crest": pageConfig.footer.crest,
"OGLLink": pageConfig.footer.OGLLink,
"button": pageConfig.header.signoutButton,