@ons/design-system 59.0.0 → 60.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/access-code/uac.scss +1 -1
- package/components/autosuggest/_autosuggest.scss +1 -1
- package/components/button/_button.scss +3 -3
- package/components/download-resources/_download-resources.scss +1 -1
- package/components/fieldset/_fieldset.scss +2 -2
- package/components/footer/_footer.scss +0 -15
- package/components/footer/_macro.njk +62 -103
- package/components/footer/_macro.spec.js +56 -186
- package/components/header/_header.scss +23 -25
- package/components/header/_macro.njk +133 -148
- package/components/header/_macro.spec.js +39 -73
- package/components/hero/_hero.scss +4 -0
- package/components/hero/_macro.njk +35 -92
- package/components/hero/_macro.spec.js +54 -190
- package/components/icons/_macro.njk +0 -499
- package/components/icons/_macro.spec.js +0 -14
- package/components/navigation/_macro.njk +14 -14
- package/components/navigation/_macro.spec.js +3 -5
- package/components/navigation/_navigation.scss +4 -4
- package/components/panel/_panel.scss +1 -1
- package/components/summary/_summary.scss +2 -2
- package/components/table/_table.scss +3 -3
- package/css/main.css +3 -3
- package/fonts/opensans-bold.woff +0 -0
- package/fonts/opensans-bold.woff2 +0 -0
- package/fonts/opensans-regular.woff +0 -0
- package/fonts/opensans-regular.woff2 +0 -0
- package/img/large/placeholder-card.png +0 -0
- package/img/large/placeholder-news-medium.png +0 -0
- package/img/large/placeholder-news.png +0 -0
- package/img/large/placeholder-portrait.png +0 -0
- package/img/small/placeholder-card.png +0 -0
- package/img/small/placeholder-news-medium.png +0 -0
- package/img/small/placeholder-news.png +0 -0
- package/img/small/placeholder-portrait.png +0 -0
- package/js/main.js +0 -1
- package/layout/_template.njk +51 -62
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_typography.scss +1 -0
- package/scss/main.scss +0 -2
- package/scss/patternlib.scss +2 -1
- package/scss/utilities/_typography.scss +1 -1
- package/scss/vars/_colors.scss +9 -4
- package/scss/vars/_typography.scss +1 -1
- package/components/find-a-support-centre/_find-a-support-centre.scss +0 -9
- package/components/promotional-banner/_macro.njk +0 -49
- package/components/promotional-banner/_macro.spec.js +0 -97
- package/components/promotional-banner/_promo-banner.scss +0 -72
- package/components/select/select.js +0 -19
- package/components/select/select.spec.js +0 -56
- package/css/census.css +0 -243
- package/css/ids.css +0 -243
- package/favicons/browserconfig.xml +0 -12
- package/favicons/census/cy/android-chrome-192x192.png +0 -0
- package/favicons/census/cy/android-chrome-512x512.png +0 -0
- package/favicons/census/cy/apple-touch-icon.png +0 -0
- package/favicons/census/cy/browserconfig.xml +0 -12
- package/favicons/census/cy/favicon-16x16.png +0 -0
- package/favicons/census/cy/favicon-32x32.png +0 -0
- package/favicons/census/cy/favicon.ico +0 -0
- package/favicons/census/cy/manifest.json +0 -20
- package/favicons/census/cy/mstitle-150x150.png +0 -0
- package/favicons/census/cy/mstitle-310x150.png +0 -0
- package/favicons/census/cy/mstitle-310x310.png +0 -0
- package/favicons/census/cy/mstitle-70x70.png +0 -0
- package/favicons/census/cy/opengraph.png +0 -0
- package/favicons/census/cy/safari-pinned-tab.svg +0 -3
- package/favicons/census/cy/site.webmanifest +0 -19
- package/favicons/census/cy/twitter.png +0 -0
- package/favicons/census/en/android-chrome-192x192.png +0 -0
- package/favicons/census/en/android-chrome-512x512.png +0 -0
- package/favicons/census/en/apple-touch-icon.png +0 -0
- package/favicons/census/en/browserconfig.xml +0 -12
- package/favicons/census/en/favicon-16x16.png +0 -0
- package/favicons/census/en/favicon-32x32.png +0 -0
- package/favicons/census/en/favicon.ico +0 -0
- package/favicons/census/en/manifest.json +0 -20
- package/favicons/census/en/mstitle-150x150.png +0 -0
- package/favicons/census/en/mstitle-310x150.png +0 -0
- package/favicons/census/en/mstitle-310x310.png +0 -0
- package/favicons/census/en/mstitle-70x70.png +0 -0
- package/favicons/census/en/opengraph.png +0 -0
- package/favicons/census/en/safari-pinned-tab.svg +0 -3
- package/favicons/census/en/site.webmanifest +0 -19
- package/favicons/census/en/twitter.png +0 -0
- package/favicons/census/ni/favicon.ico +0 -0
- package/favicons/ids/cy/android-chrome-192x192.png +0 -0
- package/favicons/ids/cy/android-chrome-512x512.png +0 -0
- package/favicons/ids/cy/apple-touch-icon.png +0 -0
- package/favicons/ids/cy/browserconfig.xml +0 -12
- package/favicons/ids/cy/favicon-16x16.png +0 -0
- package/favicons/ids/cy/favicon-32x32.png +0 -0
- package/favicons/ids/cy/favicon.ico +0 -0
- package/favicons/ids/cy/manifest.json +0 -20
- package/favicons/ids/cy/mstile-150x150.png +0 -0
- package/favicons/ids/cy/mstile-310x150.png +0 -0
- package/favicons/ids/cy/mstile-310x310.png +0 -0
- package/favicons/ids/cy/mstile-70x70.png +0 -0
- package/favicons/ids/cy/opengraph.png +0 -0
- package/favicons/ids/cy/safari-pinned-tab.svg +0 -27
- package/favicons/ids/cy/site.webmanifest +0 -54
- package/favicons/ids/cy/twitter.png +0 -0
- package/favicons/ids/en/android-chrome-192x192.png +0 -0
- package/favicons/ids/en/android-chrome-512x512.png +0 -0
- package/favicons/ids/en/apple-touch-icon.png +0 -0
- package/favicons/ids/en/browserconfig.xml +0 -12
- package/favicons/ids/en/favicon-16x16.png +0 -0
- package/favicons/ids/en/favicon-32x32.png +0 -0
- package/favicons/ids/en/favicon.ico +0 -0
- package/favicons/ids/en/manifest.json +0 -20
- package/favicons/ids/en/mstile-150x150.png +0 -0
- package/favicons/ids/en/mstile-310x150.png +0 -0
- package/favicons/ids/en/mstile-310x310.png +0 -0
- package/favicons/ids/en/mstile-70x70.png +0 -0
- package/favicons/ids/en/opengraph.png +0 -0
- package/favicons/ids/en/safari-pinned-tab.svg +0 -27
- package/favicons/ids/en/site.webmanifest +0 -54
- package/favicons/ids/en/twitter.png +0 -0
- package/favicons/mstitle-150x150.png +0 -0
- package/favicons/mstitle-310x150.png +0 -0
- package/favicons/mstitle-310x310.png +0 -0
- package/favicons/mstitle-70x70.png +0 -0
- package/img/UKOpenGovernmentLicence-grey.svg +0 -4
- package/img/UKOpenGovernmentLicence.svg +0 -13
- package/img/card-placeholder.svg +0 -14
- package/img/census-landscape.svg +0 -4514
- package/img/census-logo-stacked-pos-billingual.png +0 -0
- package/img/census-logo-stacked-pos-cy.png +0 -0
- package/img/census-logo-stacked-pos-en.png +0 -0
- package/img/census-promo-banner.svg +0 -489
- package/img/circle-lines.svg +0 -31
- package/img/dummy-brand-logo.svg +0 -6
- package/img/icons--check.svg +0 -3
- package/img/icons--chevron-down.svg +0 -3
- package/img/its-about-us--dark.svg +0 -4
- package/img/its-about-us--light.svg +0 -4
- package/img/large/hero-man.png +0 -0
- package/img/logo.svg +0 -77
- package/img/ni-syn-cyfrif--dark.svg +0 -3
- package/img/ni-syn-cyfrif--light.svg +0 -3
- package/img/nisra-logo-black-en.svg +0 -4
- package/img/ogl.svg +0 -10
- package/img/ons-logo-black-cy.svg +0 -4
- package/img/ons-logo-black-en.svg +0 -4
- package/img/people-mob.png +0 -0
- package/img/people.png +0 -0
- package/img/rehearsal-areas.svg +0 -11
- package/img/small/hero-man.png +0 -0
- package/scss/census.scss +0 -2
- package/scss/ids.scss +0 -2
- package/scss/settings/_census.scss +0 -159
- package/scss/settings/_ids.scss +0 -52
|
@@ -139,7 +139,7 @@ $button-shadow-size: 3px;
|
|
|
139
139
|
&__inner {
|
|
140
140
|
background: var(--ons-color-button-secondary);
|
|
141
141
|
color: var(--ons-color-text);
|
|
142
|
-
font-weight:
|
|
142
|
+
font-weight: $font-weight-regular;
|
|
143
143
|
|
|
144
144
|
.ons-svg-icon {
|
|
145
145
|
fill: var(--ons-color-text);
|
|
@@ -187,7 +187,7 @@ $button-shadow-size: 3px;
|
|
|
187
187
|
border-radius: 0;
|
|
188
188
|
box-shadow: none;
|
|
189
189
|
color: var(--ons-color-text-link);
|
|
190
|
-
font-weight:
|
|
190
|
+
font-weight: $font-weight-regular;
|
|
191
191
|
padding: 0;
|
|
192
192
|
.ons-svg-icon {
|
|
193
193
|
fill: var(--ons-color-text-link);
|
|
@@ -445,7 +445,7 @@ $button-shadow-size: 3px;
|
|
|
445
445
|
color: var(--ons-color-branded-text);
|
|
446
446
|
display: block;
|
|
447
447
|
font-size: 1rem;
|
|
448
|
-
font-weight:
|
|
448
|
+
font-weight: $font-weight-regular;
|
|
449
449
|
padding: 0.6rem 1rem;
|
|
450
450
|
text-align: left;
|
|
451
451
|
|
|
@@ -49,19 +49,4 @@
|
|
|
49
49
|
margin-bottom: 0.5rem !important;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
&__poweredby,
|
|
54
|
-
&__crest,
|
|
55
|
-
&__partnership {
|
|
56
|
-
font-size: 0;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&__partnership {
|
|
60
|
-
&-prefix {
|
|
61
|
-
@extend .ons-u-fs-s;
|
|
62
|
-
|
|
63
|
-
margin-bottom: 0.2rem;
|
|
64
|
-
margin-top: -0.3rem;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
52
|
}
|
|
@@ -29,18 +29,6 @@
|
|
|
29
29
|
{% endif %}
|
|
30
30
|
{% endset %}
|
|
31
31
|
|
|
32
|
-
{% set poweredByLogo %}
|
|
33
|
-
{% if params.poweredBy and params.poweredBy.logo %}
|
|
34
|
-
{{
|
|
35
|
-
onsIcon({
|
|
36
|
-
"iconType": params.poweredBy.logo,
|
|
37
|
-
"altText": params.poweredBy.alt,
|
|
38
|
-
"altTextId": 'poweredby-alt'
|
|
39
|
-
})
|
|
40
|
-
}}
|
|
41
|
-
{% endif %}
|
|
42
|
-
{% endset %}
|
|
43
|
-
|
|
44
32
|
<footer class="ons-footer">
|
|
45
33
|
|
|
46
34
|
{% if params.footerWarning %}
|
|
@@ -122,116 +110,87 @@
|
|
|
122
110
|
<hr class="ons-footer__hr">
|
|
123
111
|
</div>
|
|
124
112
|
{% endif %}
|
|
125
|
-
|
|
126
113
|
</div>
|
|
127
114
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
115
|
+
<div class="ons-grid ons-grid--flex ons-grid--vertical-top ons-grid--between">
|
|
116
|
+
<div class="ons-grid__col">
|
|
117
|
+
{% if params.legal %}
|
|
118
|
+
<!-- Legal -->
|
|
119
|
+
{% for legal in params.legal %}
|
|
120
|
+
{{
|
|
121
|
+
onsList({
|
|
122
|
+
"classes": 'ons-u-mb-s ons-footer--rows',
|
|
123
|
+
"variants": ['bare', 'inline'],
|
|
124
|
+
"itemsList": legal.itemsList
|
|
125
|
+
})
|
|
126
|
+
}}
|
|
127
|
+
{% endfor %}
|
|
128
|
+
{% endif %}
|
|
142
129
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
130
|
+
{% if params.OGLLink %}
|
|
131
|
+
<!-- OGL -->
|
|
132
|
+
<div class="ons-footer__license ons-u-mb-m">
|
|
133
|
+
{{
|
|
134
|
+
onsIcon({
|
|
135
|
+
"iconType": 'ogl'
|
|
136
|
+
})
|
|
137
|
+
}}
|
|
138
|
+
{% if params.OGLLink.HTML %}
|
|
139
|
+
{{ params.OGLLink.HTML | safe }}
|
|
140
|
+
{% elif params.OGLLink %}
|
|
141
|
+
{% from "components/external-link/_macro.njk" import onsExternalLink %}
|
|
142
|
+
{% if params.lang == 'cy' %}
|
|
143
|
+
{{ params.OGLLink.pre | default('Mae’r holl gynnwys ar gael o dan y') }} {{
|
|
144
|
+
onsExternalLink({
|
|
145
|
+
"url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
|
|
146
|
+
"linkText": params.OGLLink.link | default('Drwydded Llywodraeth Leol v3.0')
|
|
149
147
|
})
|
|
150
|
-
|
|
151
|
-
{%
|
|
152
|
-
{{ params.OGLLink.
|
|
153
|
-
{% elif params.OGLLink %}
|
|
154
|
-
{% from "components/external-link/_macro.njk" import onsExternalLink %}
|
|
155
|
-
{% if params.lang == 'cy' %}
|
|
156
|
-
{{ params.OGLLink.pre | default('Mae’r holl gynnwys ar gael o dan y') }} {{
|
|
148
|
+
}}{{ params.OGLLink.post | default(', oni bai y nodir fel arall') }}
|
|
149
|
+
{% else %}
|
|
150
|
+
{{ params.OGLLink.pre | default('All content is available under the') }} {{
|
|
157
151
|
onsExternalLink({
|
|
158
152
|
"url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
|
|
159
|
-
"linkText": params.OGLLink.link | default('
|
|
153
|
+
"linkText": params.OGLLink.link | default('Open Government Licence v3.0')
|
|
160
154
|
})
|
|
161
|
-
|
|
162
|
-
{% else %}
|
|
163
|
-
{{ params.OGLLink.pre | default('All content is available under the') }} {{
|
|
164
|
-
onsExternalLink({
|
|
165
|
-
"url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
|
|
166
|
-
"linkText": params.OGLLink.link | default('Open Government Licence v3.0')
|
|
167
|
-
})
|
|
168
|
-
}}{{ params.OGLLink.post | default(', except where otherwise stated') }}
|
|
169
|
-
{% endif %}
|
|
155
|
+
}}{{ params.OGLLink.post | default(', except where otherwise stated') }}
|
|
170
156
|
{% endif %}
|
|
171
|
-
</div>
|
|
172
|
-
{% endif %}
|
|
173
|
-
|
|
174
|
-
{% if params.poweredBy %}
|
|
175
|
-
{% if not params.poweredBy.partnership %}
|
|
176
|
-
<div class="ons-footer__poweredby ons-u-mb-m">
|
|
177
|
-
{{ poweredByLogo | safe }}
|
|
178
|
-
</div>
|
|
179
157
|
{% endif %}
|
|
180
|
-
{% else %}
|
|
181
|
-
<div class="ons-footer__poweredby ons-u-mb-m">
|
|
182
|
-
{{ onsLogo | safe }}
|
|
183
|
-
</div>
|
|
184
|
-
{% endif %}
|
|
185
|
-
</div>
|
|
186
|
-
|
|
187
|
-
{% if params.crest %}
|
|
188
|
-
<!-- Crest -->
|
|
189
|
-
<div class="ons-grid__col ons-footer__crest ons-u-mb-m@xxs@l">
|
|
190
|
-
{{
|
|
191
|
-
onsIcon({
|
|
192
|
-
"iconType": 'crest'
|
|
193
|
-
})
|
|
194
|
-
}}
|
|
195
158
|
</div>
|
|
196
159
|
{% endif %}
|
|
197
160
|
</div>
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between ons-footer__poweredby">
|
|
164
|
+
{% if params.poweredBy %}
|
|
165
|
+
{{ params.poweredBy | safe }}
|
|
166
|
+
{% else %}
|
|
167
|
+
<div class="ons-grid__col ons-u-mb-m">
|
|
168
|
+
{{ onsLogo | safe }}
|
|
203
169
|
</div>
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
{{
|
|
217
|
-
onsIcon({
|
|
218
|
-
"iconType": 'ons-logo-en',
|
|
219
|
-
"altText": 'Office for National Statistics',
|
|
220
|
-
"altTextId": 'ons-logo-en-footer-alt'
|
|
221
|
-
})
|
|
222
|
-
}}
|
|
223
|
-
{% endif %}
|
|
170
|
+
{% endif %}
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
{% if params.crest %}
|
|
174
|
+
<!-- Crest -->
|
|
175
|
+
<div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between">
|
|
176
|
+
<div class="ons-grid__col ons-footer__crest ons-u-mb-m@xxs@l">
|
|
177
|
+
{{
|
|
178
|
+
onsIcon({
|
|
179
|
+
"iconType": 'crest'
|
|
180
|
+
})
|
|
181
|
+
}}
|
|
224
182
|
</div>
|
|
225
183
|
</div>
|
|
184
|
+
|
|
226
185
|
{% endif %}
|
|
227
186
|
|
|
228
187
|
{% if params.copyrightDeclaration %}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
188
|
+
<!-- Copyright -->
|
|
189
|
+
<div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between">
|
|
190
|
+
<div class="ons-grid__col">
|
|
191
|
+
<p class="ons-u-fs-s ons-u-mb-no ons-footer__copyright">© {{ params.copyrightDeclaration.copyright }} <br> {{ params.copyrightDeclaration.text }}</p>
|
|
192
|
+
</div>
|
|
233
193
|
</div>
|
|
234
|
-
</div>
|
|
235
194
|
{% endif %}
|
|
236
195
|
</div>
|
|
237
196
|
</div>
|
|
@@ -6,17 +6,6 @@ import axe from '../../tests/helpers/axe';
|
|
|
6
6
|
import { mapAll } from '../../tests/helpers/cheerio';
|
|
7
7
|
import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
|
|
8
8
|
|
|
9
|
-
const EXAMPLE_POWERED_BY_PARAM = {
|
|
10
|
-
logo: 'person',
|
|
11
|
-
alt: 'Person alt text',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const EXAMPLE_POWERED_BY_WITH_PARTNERSHIP_PARAM = {
|
|
15
|
-
logo: 'person',
|
|
16
|
-
alt: 'Person alt text',
|
|
17
|
-
partnership: 'Prefix text string',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
9
|
const EXAMPLE_OGL_LINK_PARAM = {
|
|
21
10
|
pre: 'All content is available under the',
|
|
22
11
|
link: 'Open Government Licence v3.0',
|
|
@@ -365,162 +354,102 @@ describe('macro: footer', () => {
|
|
|
365
354
|
});
|
|
366
355
|
});
|
|
367
356
|
|
|
368
|
-
describe('
|
|
369
|
-
describe
|
|
370
|
-
[
|
|
371
|
-
'the `lang` parameter is not provided',
|
|
372
|
-
{},
|
|
373
|
-
{
|
|
374
|
-
iconType: 'ons-logo-en',
|
|
375
|
-
altText: 'Office for National Statistics',
|
|
376
|
-
},
|
|
377
|
-
],
|
|
378
|
-
[
|
|
379
|
-
'the `lang` parameter is "en"',
|
|
380
|
-
{ lang: 'en' },
|
|
381
|
-
{
|
|
382
|
-
iconType: 'ons-logo-en',
|
|
383
|
-
altText: 'Office for National Statistics',
|
|
384
|
-
},
|
|
385
|
-
],
|
|
386
|
-
[
|
|
387
|
-
'the `lang` parameter is "cy"',
|
|
388
|
-
{ lang: 'cy' },
|
|
389
|
-
{
|
|
390
|
-
iconType: 'ons-logo-cy',
|
|
391
|
-
altText: 'Swyddfa Ystadegau Gwladol',
|
|
392
|
-
},
|
|
393
|
-
],
|
|
394
|
-
])('where %s', (_, langParams, defaultIcon) => {
|
|
357
|
+
describe('poweredBy logo', () => {
|
|
358
|
+
describe('default poweredBy logo', () => {
|
|
395
359
|
describe.each([
|
|
396
360
|
[
|
|
397
|
-
'the `
|
|
361
|
+
'the `lang` parameter is not provided',
|
|
362
|
+
{},
|
|
398
363
|
{
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
iconType: 'person',
|
|
404
|
-
altText: 'Person alt text',
|
|
364
|
+
iconType: 'ons-logo-en',
|
|
365
|
+
altText: 'Office for National Statistics',
|
|
405
366
|
},
|
|
406
367
|
],
|
|
407
368
|
[
|
|
408
|
-
'the `
|
|
409
|
-
{
|
|
410
|
-
poweredBy: EXAMPLE_POWERED_BY_WITH_PARTNERSHIP_PARAM,
|
|
411
|
-
OGLLink: EXAMPLE_OGL_LINK_PARAM,
|
|
412
|
-
},
|
|
369
|
+
'the `lang` parameter is "en"',
|
|
370
|
+
{ lang: 'en' },
|
|
413
371
|
{
|
|
414
|
-
iconType: '
|
|
415
|
-
altText: '
|
|
372
|
+
iconType: 'ons-logo-en',
|
|
373
|
+
altText: 'Office for National Statistics',
|
|
416
374
|
},
|
|
417
375
|
],
|
|
376
|
+
])('where %s', (_, langParams, defaultIcon) => {
|
|
377
|
+
const params = {
|
|
378
|
+
...langParams,
|
|
379
|
+
};
|
|
380
|
+
it('renders the expected icon', () => {
|
|
381
|
+
const faker = templateFaker();
|
|
382
|
+
const iconsSpy = faker.spy('icons');
|
|
383
|
+
|
|
384
|
+
faker.renderComponent('footer', params);
|
|
385
|
+
|
|
386
|
+
expect(iconsSpy.occurrences).toContainEqual(expect.objectContaining(defaultIcon));
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
describe('provided poweredBy logo', () => {
|
|
391
|
+
describe.each([
|
|
418
392
|
[
|
|
419
|
-
'the `
|
|
393
|
+
'the `lang` parameter is "cy"',
|
|
394
|
+
{ lang: 'cy' },
|
|
420
395
|
{
|
|
421
|
-
|
|
396
|
+
iconType: 'ons-logo-cy',
|
|
397
|
+
altText: 'Swyddfa Ystadegau Gwladol',
|
|
422
398
|
},
|
|
423
|
-
defaultIcon,
|
|
424
399
|
],
|
|
400
|
+
])('where %s', (_, langParams, defaultIcon) => {
|
|
401
|
+
const params = {
|
|
402
|
+
...langParams,
|
|
403
|
+
};
|
|
404
|
+
it('renders the expected icon', () => {
|
|
405
|
+
const faker = templateFaker();
|
|
406
|
+
const iconsSpy = faker.spy('icons');
|
|
407
|
+
|
|
408
|
+
faker.renderComponent('footer', params);
|
|
409
|
+
|
|
410
|
+
expect(iconsSpy.occurrences).toContainEqual(expect.objectContaining(defaultIcon));
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
});
|
|
414
|
+
describe('provided poweredBy logo', () => {
|
|
415
|
+
describe.each([
|
|
425
416
|
[
|
|
426
|
-
'the `poweredBy`
|
|
417
|
+
'the `poweredBy` and `OGLLink` parameters are provided',
|
|
427
418
|
{
|
|
428
|
-
|
|
419
|
+
poweredBy: '<img src="logo.svg" alt="logo">',
|
|
429
420
|
OGLLink: EXAMPLE_OGL_LINK_PARAM,
|
|
430
421
|
},
|
|
431
|
-
defaultIcon,
|
|
432
422
|
],
|
|
433
423
|
[
|
|
434
424
|
'the `poweredBy` and `legal` parameters are provided',
|
|
435
425
|
{
|
|
436
|
-
poweredBy:
|
|
426
|
+
poweredBy: '<img src="logo.svg" alt="logo">',
|
|
437
427
|
legal: EXAMPLE_LEGAL_PARAM,
|
|
438
428
|
},
|
|
439
|
-
{
|
|
440
|
-
iconType: 'person',
|
|
441
|
-
altText: 'Person alt text',
|
|
442
|
-
},
|
|
443
|
-
],
|
|
444
|
-
[
|
|
445
|
-
'the `poweredBy.partnership` and `legal` parameters are provided',
|
|
446
|
-
{
|
|
447
|
-
poweredBy: EXAMPLE_POWERED_BY_WITH_PARTNERSHIP_PARAM,
|
|
448
|
-
legal: EXAMPLE_LEGAL_PARAM,
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
iconType: 'person',
|
|
452
|
-
altText: 'Person alt text',
|
|
453
|
-
},
|
|
454
429
|
],
|
|
455
430
|
[
|
|
456
431
|
'the `poweredBy` and `crest` parameters are provided',
|
|
457
432
|
{
|
|
458
|
-
poweredBy:
|
|
433
|
+
poweredBy: '<img src="logo.svg" alt="logo">',
|
|
459
434
|
crest: true,
|
|
460
435
|
},
|
|
461
|
-
{
|
|
462
|
-
iconType: 'person',
|
|
463
|
-
altText: 'Person alt text',
|
|
464
|
-
},
|
|
465
|
-
],
|
|
466
|
-
[
|
|
467
|
-
'the `poweredBy.partnership` and `crest` parameters are provided',
|
|
468
|
-
{
|
|
469
|
-
poweredBy: EXAMPLE_POWERED_BY_WITH_PARTNERSHIP_PARAM,
|
|
470
|
-
crest: true,
|
|
471
|
-
},
|
|
472
|
-
{
|
|
473
|
-
iconType: 'person',
|
|
474
|
-
altText: 'Person alt text',
|
|
475
|
-
},
|
|
476
436
|
],
|
|
477
437
|
[
|
|
478
438
|
'the `poweredBy`, `legal` and `crest` parameters are provided',
|
|
479
439
|
{
|
|
480
|
-
poweredBy:
|
|
481
|
-
legal: EXAMPLE_LEGAL_PARAM,
|
|
482
|
-
crest: true,
|
|
483
|
-
},
|
|
484
|
-
{
|
|
485
|
-
iconType: 'person',
|
|
486
|
-
altText: 'Person alt text',
|
|
487
|
-
},
|
|
488
|
-
],
|
|
489
|
-
[
|
|
490
|
-
'the `poweredBy.partnership`, `legal` and `crest` parameters are provided',
|
|
491
|
-
{
|
|
492
|
-
poweredBy: EXAMPLE_POWERED_BY_WITH_PARTNERSHIP_PARAM,
|
|
440
|
+
poweredBy: '<img src="logo.svg" alt="logo">',
|
|
493
441
|
legal: EXAMPLE_LEGAL_PARAM,
|
|
494
442
|
crest: true,
|
|
495
443
|
},
|
|
496
|
-
{
|
|
497
|
-
iconType: 'person',
|
|
498
|
-
altText: 'Person alt text',
|
|
499
|
-
},
|
|
500
444
|
],
|
|
501
445
|
[
|
|
502
446
|
'the `poweredBy` parameter is provided but the `legal` and `crest` parameters are not provided',
|
|
503
447
|
{
|
|
504
|
-
poweredBy:
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
iconType: 'person',
|
|
508
|
-
altText: 'Person alt text',
|
|
448
|
+
poweredBy: '<img src="logo.svg" alt="logo">',
|
|
509
449
|
},
|
|
510
450
|
],
|
|
511
|
-
|
|
512
|
-
'the `poweredBy.partnership` parameter is provided but the `legal` and `crest` parameters are not provided',
|
|
513
|
-
{
|
|
514
|
-
poweredBy: EXAMPLE_POWERED_BY_WITH_PARTNERSHIP_PARAM,
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
iconType: 'person',
|
|
518
|
-
altText: 'Person alt text',
|
|
519
|
-
},
|
|
520
|
-
],
|
|
521
|
-
])('where %s', (_, poweredByParams, expectedIcon) => {
|
|
451
|
+
])('where %s', (_, poweredByParams) => {
|
|
522
452
|
const params = {
|
|
523
|
-
...langParams,
|
|
524
453
|
...poweredByParams,
|
|
525
454
|
};
|
|
526
455
|
|
|
@@ -531,13 +460,10 @@ describe('macro: footer', () => {
|
|
|
531
460
|
expect(results).toHaveNoViolations();
|
|
532
461
|
});
|
|
533
462
|
|
|
534
|
-
it('renders the expected
|
|
535
|
-
const
|
|
536
|
-
const iconsSpy = faker.spy('icons');
|
|
537
|
-
|
|
538
|
-
faker.renderComponent('footer', params);
|
|
463
|
+
it('renders the expected logo', () => {
|
|
464
|
+
const $ = cheerio.load(renderComponent('footer', params));
|
|
539
465
|
|
|
540
|
-
expect(
|
|
466
|
+
expect($('.ons-footer__poweredby img').attr('src')).toBe('logo.svg');
|
|
541
467
|
});
|
|
542
468
|
});
|
|
543
469
|
});
|
|
@@ -631,60 +557,4 @@ describe('macro: footer', () => {
|
|
|
631
557
|
expect($('.ons-footer__crest').length).toBe(1);
|
|
632
558
|
});
|
|
633
559
|
});
|
|
634
|
-
|
|
635
|
-
describe('partnership', () => {
|
|
636
|
-
const params = {
|
|
637
|
-
poweredBy: EXAMPLE_POWERED_BY_WITH_PARTNERSHIP_PARAM,
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
it('passes jest-axe checks', async () => {
|
|
641
|
-
const $ = cheerio.load(renderComponent('footer', params));
|
|
642
|
-
|
|
643
|
-
const results = await axe($.html());
|
|
644
|
-
expect(results).toHaveNoViolations();
|
|
645
|
-
});
|
|
646
|
-
|
|
647
|
-
it('renders ONS icon when `partnership` parameter is provided', () => {
|
|
648
|
-
const faker = templateFaker();
|
|
649
|
-
const iconsSpy = faker.spy('icons');
|
|
650
|
-
|
|
651
|
-
faker.renderComponent('footer', params);
|
|
652
|
-
|
|
653
|
-
expect(iconsSpy.occurrences).toContainEqual(expect.objectContaining({ iconType: 'ons-logo-en' }));
|
|
654
|
-
});
|
|
655
|
-
|
|
656
|
-
it('renders "poweredBy" icon when `partnership` parameter is provided', () => {
|
|
657
|
-
const faker = templateFaker();
|
|
658
|
-
const iconsSpy = faker.spy('icons');
|
|
659
|
-
|
|
660
|
-
faker.renderComponent('footer', params);
|
|
661
|
-
|
|
662
|
-
expect(iconsSpy.occurrences).toContainEqual(expect.objectContaining({ iconType: 'person' }));
|
|
663
|
-
});
|
|
664
|
-
|
|
665
|
-
it('renders "poweredBy" element when `partnership` parameter is provided', () => {
|
|
666
|
-
const $ = cheerio.load(renderComponent('footer', params));
|
|
667
|
-
|
|
668
|
-
expect($('.ons-footer__poweredby').length).toBe(1);
|
|
669
|
-
});
|
|
670
|
-
|
|
671
|
-
it('renders "partnership" and "prefix" elements when `partnership` parameter is provided', () => {
|
|
672
|
-
const $ = cheerio.load(renderComponent('footer', params));
|
|
673
|
-
|
|
674
|
-
expect($('.ons-footer__partnership').length).toBe(1);
|
|
675
|
-
expect($('.ons-footer__partnership-prefix').length).toBe(1);
|
|
676
|
-
});
|
|
677
|
-
|
|
678
|
-
it('does not render "partnership" element when `partnership` parameter is not provided', () => {
|
|
679
|
-
const params = {
|
|
680
|
-
poweredBy: {
|
|
681
|
-
logo: 'person',
|
|
682
|
-
alt: 'Person alt text',
|
|
683
|
-
},
|
|
684
|
-
};
|
|
685
|
-
const $ = cheerio.load(renderComponent('footer', params));
|
|
686
|
-
|
|
687
|
-
expect($('.ons-footer__partnership').length).toBe(0);
|
|
688
|
-
});
|
|
689
|
-
});
|
|
690
560
|
});
|