@ons/design-system 63.0.0 → 65.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/_macro.njk +2 -2
- package/components/access-code/_macro.spec.js +2 -2
- package/components/access-code/access-code.dom.js +11 -0
- package/components/access-code/{uac.js → access-code.js} +1 -1
- package/components/access-code/{uac.scss → access-code.scss} +1 -1
- package/components/access-code/example-access-code-error.njk +6 -6
- package/components/access-code/example-access-code.njk +4 -4
- package/components/accordion/_macro.njk +2 -2
- package/components/accordion/_macro.spec.js +3 -3
- package/components/accordion/accordion.dom.js +1 -1
- package/components/accordion/accordion.js +1 -1
- package/components/breadcrumbs/_breadcrumbs.scss +6 -6
- package/components/breadcrumbs/_macro.njk +4 -4
- package/components/breadcrumbs/_macro.spec.js +13 -13
- package/components/button/_button.scss +27 -27
- package/components/button/_macro.spec.js +2 -2
- package/components/call-to-action/_macro.njk +1 -1
- package/components/char-check-limit/_macro.njk +1 -1
- package/components/char-check-limit/_macro.spec.js +1 -1
- package/components/char-check-limit/character-check.spec.js +16 -16
- package/components/checkboxes/_macro.njk +3 -1
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +1 -0
- package/components/cookies-banner/_macro.njk +2 -2
- package/components/cookies-banner/_macro.spec.js +2 -2
- package/components/date-input/_macro.njk +3 -3
- package/components/date-input/_macro.spec.js +118 -0
- package/components/date-input/example-date-input-error-for-single-field.njk +63 -0
- package/components/details/_details.scss +1 -1
- package/components/external-link/_external-link.scss +3 -3
- package/components/external-link/_macro.njk +1 -1
- package/components/footer/_footer.scss +2 -2
- package/components/footer/example-footer-with-alternative-organisation.njk +5 -5
- package/components/header/_header.scss +8 -8
- package/components/icon/_icon.scss +1 -1
- package/components/icon/_macro.njk +35 -35
- package/components/icon/_macro.spec.js +1 -1
- package/components/image/_image.scss +2 -2
- package/components/image/_macro.njk +4 -6
- package/components/image/_macro.spec.js +10 -10
- package/components/input/_input.scss +6 -0
- package/components/input/_macro.njk +20 -13
- package/components/input/_macro.spec.js +2 -22
- package/components/{search/example-search-with-character-check.njk → input/example-input-search-with-character-check.njk} +1 -2
- package/components/{search/example-search-with-placeholder.njk → input/example-input-search-with-placeholder.njk} +1 -2
- package/components/{search/example-search.njk → input/example-input-search.njk} +1 -2
- package/components/mutually-exclusive/_macro.njk +4 -3
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +1 -1
- package/components/pagination/_macro.njk +2 -2
- package/components/pagination/example-pagination-first.njk +0 -2
- package/components/pagination/example-pagination-last.njk +0 -2
- package/components/pagination/example-pagination-with-no-range-indicator.njk +0 -2
- package/components/pagination/example-pagination.njk +0 -2
- package/components/panel/_macro.njk +1 -1
- package/components/panel/_panel.scss +7 -7
- package/components/password/_macro.njk +1 -1
- package/components/password/example-password.njk +1 -2
- package/components/quote/_quote.scss +1 -1
- package/components/radios/_macro.njk +1 -1
- package/components/select/_macro.njk +1 -2
- package/components/skip-to-content/_macro.njk +2 -1
- package/components/skip-to-content/_macro.spec.js +17 -3
- package/components/skip-to-content/_skip.scss +1 -1
- package/components/skip-to-content/skip-to-content.dom.js +1 -1
- package/components/skip-to-content/skip-to-content.spec.js +3 -3
- package/components/summary/_macro.njk +1 -2
- package/components/summary/_macro.spec.js +7 -22
- package/components/summary/_summary.scss +1 -1
- package/components/summary/example-summary-grouped-total.njk +0 -2
- package/components/summary/example-summary-grouped-with-errors.njk +0 -4
- package/components/summary/example-summary-grouped.njk +0 -19
- package/components/summary/example-summary-household.njk +0 -5
- package/components/summary/example-summary-hub.njk +0 -8
- package/components/summary/example-summary-multiple.njk +0 -4
- package/components/summary/example-summary.njk +0 -4
- package/components/table/_macro.njk +1 -1
- package/components/table/_macro.spec.js +16 -0
- package/components/table/_table.scss +6 -6
- package/components/table/example-table-numeric.njk +6 -3
- package/components/table/sortable-table.js +1 -1
- package/components/tabs/_macro.njk +4 -3
- package/components/tabs/_macro.spec.js +23 -0
- package/components/tabs/_tabs.scss +11 -15
- package/components/tabs/example-tabs.njk +6 -6
- package/components/tabs/tabs.js +24 -8
- package/components/tabs/tabs.spec.js +40 -2
- package/components/textarea/_macro.njk +2 -2
- package/components/textarea/_macro.spec.js +2 -2
- package/components/textarea/textarea.spec.js +6 -10
- package/components/timeline/_macro.njk +18 -22
- package/components/timeline/_macro.spec.js +18 -0
- package/components/video/example-video.njk +1 -1
- package/components/video/video.js +10 -1
- package/components/video/video.spec.js +33 -0
- package/css/main.css +3 -3
- package/css/print.css +1 -1
- package/js/main.js +1 -1
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_global.scss +1 -1
- package/scss/main.scss +1 -2
- package/scss/objects/_spacing.scss +3 -3
- package/scss/overrides/hcm.scss +6 -6
- package/scss/overrides/rtl.scss +2 -2
- package/scss/print.scss +1 -1
- package/components/access-code/uac.dom.js +0 -11
- package/components/search/_macro.njk +0 -30
- package/components/search/_macro.spec.js +0 -69
- package/components/search/_search.scss +0 -9
- /package/components/access-code/{uac.spec.js → access-code.spec.js} +0 -0
|
@@ -535,26 +535,6 @@ describe('macro: input', () => {
|
|
|
535
535
|
});
|
|
536
536
|
|
|
537
537
|
describe('search', () => {
|
|
538
|
-
it('renders `search` component', () => {
|
|
539
|
-
const faker = templateFaker();
|
|
540
|
-
const searchSpy = faker.spy('search');
|
|
541
|
-
|
|
542
|
-
faker.renderComponent('input', EXAMPLE_WITH_SEARCH);
|
|
543
|
-
|
|
544
|
-
expect(searchSpy.occurrences[0]).toEqual({
|
|
545
|
-
accessiblePlaceholder: true,
|
|
546
|
-
searchButton: {
|
|
547
|
-
type: 'button',
|
|
548
|
-
text: 'Search for address',
|
|
549
|
-
id: 'search-for-address',
|
|
550
|
-
attributes: { a: 42 },
|
|
551
|
-
classes: 'extra-search-button-class',
|
|
552
|
-
iconType: 'search',
|
|
553
|
-
visuallyHideButtonText: true,
|
|
554
|
-
},
|
|
555
|
-
});
|
|
556
|
-
});
|
|
557
|
-
|
|
558
538
|
it.each('outputs `type` attribute of "search"', () => {
|
|
559
539
|
const $ = cheerio.load(renderComponent('input', EXAMPLE_WITH_SEARCH));
|
|
560
540
|
|
|
@@ -621,7 +601,7 @@ describe('macro: input', () => {
|
|
|
621
601
|
it('has data attribute which references the character limit component', () => {
|
|
622
602
|
const $ = cheerio.load(renderComponent('input', EXAMPLE_INPUT_WITH_CHARACTER_LIMIT));
|
|
623
603
|
|
|
624
|
-
expect($('.ons-input').attr('data-char-check-ref')).toBe('example-id-check
|
|
604
|
+
expect($('.ons-input').attr('data-char-check-ref')).toBe('example-id-check');
|
|
625
605
|
});
|
|
626
606
|
|
|
627
607
|
it('has data attribute which defines limit for character check', () => {
|
|
@@ -633,7 +613,7 @@ describe('macro: input', () => {
|
|
|
633
613
|
it('has `aria-describedby` attribute which references the character limit component', () => {
|
|
634
614
|
const $ = cheerio.load(renderComponent('input', EXAMPLE_INPUT_WITH_CHARACTER_LIMIT));
|
|
635
615
|
|
|
636
|
-
expect($('.ons-input').attr('aria-describedby')).toBe('example-id-check
|
|
616
|
+
expect($('.ons-input').attr('aria-describedby')).toBe('example-id-check');
|
|
637
617
|
});
|
|
638
618
|
|
|
639
619
|
it('renders character limit component', () => {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
{# Resolves caller issue in Jinja: https://github.com/pallets/jinja/issues/371 #}
|
|
8
8
|
{% set content = caller() %}
|
|
9
9
|
{% set exclusiveOptionsLength = params.exclusiveOptions | length %}
|
|
10
|
+
{% set or = params.or | default("Or") %}
|
|
10
11
|
|
|
11
12
|
{% call onsFieldset({
|
|
12
13
|
"id": params.id,
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
{% endif %}
|
|
27
28
|
{% if exclusiveOptionsLength == 1 %}
|
|
28
29
|
<p class="ons-checkboxes--mutually-exclusive__item ons-u-mt-s">
|
|
29
|
-
<span class="ons-checkboxes__label ons-u-fs-r--b" aria-hidden="true">{{
|
|
30
|
+
<span class="ons-checkboxes__label ons-u-fs-r--b" aria-hidden="true">{{ or }}</span>
|
|
30
31
|
{{
|
|
31
32
|
onsCheckbox({
|
|
32
33
|
"id": params.exclusiveOptions[0].id,
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"deselectMessage": params.deselectMessage,
|
|
39
40
|
"inputClasses": "ons-js-exclusive-option",
|
|
40
41
|
"label": {
|
|
41
|
-
"text": '<span class="ons-u-vh">' +
|
|
42
|
+
"text": '<span class="ons-u-vh">' + or + ', </span> ' + params.exclusiveOptions[0].label.text,
|
|
42
43
|
"description": params.exclusiveOptions[0].label.description
|
|
43
44
|
}
|
|
44
45
|
})
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
</p>
|
|
47
48
|
{% elif exclusiveOptionsLength > 1 %}
|
|
48
49
|
<p class="ons-checkboxes--mutually-exclusive__item ons-u-mt-s">
|
|
49
|
-
<span class="ons-checkboxes__label ons-u-fs-r--b" aria-hidden="true">{{
|
|
50
|
+
<span class="ons-checkboxes__label ons-u-fs-r--b" aria-hidden="true">{{ or }}</span>
|
|
50
51
|
{{
|
|
51
52
|
onsRadios({
|
|
52
53
|
"dontWrap": true,
|
|
@@ -63,7 +63,7 @@ describe('script: mutually-exclusive', () => {
|
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
it('then the characters remaining readout should be reset', async () => {
|
|
66
|
-
const limitText = await page.$eval('#feedback-lim
|
|
66
|
+
const limitText = await page.$eval('#feedback-lim', node => node.textContent);
|
|
67
67
|
expect(limitText).toBe('You have 200 characters remaining');
|
|
68
68
|
});
|
|
69
69
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{% if currentPageIndex != 1 %}
|
|
14
14
|
{% set prevPageIndex = currentPageIndex - 2 %}
|
|
15
15
|
<li class="ons-pagination__item ons-pagination__item--previous">
|
|
16
|
-
<a href="{{ params.pages[prevPageIndex].url }}" class="ons-pagination__link" rel="prev" aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})">{{ params.previous }}</a>
|
|
16
|
+
<a href="{{ params.pages[prevPageIndex].url }}" class="ons-pagination__link" rel="prev" aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})">{{ params.previous | default("Previous") }}</a>
|
|
17
17
|
</li>
|
|
18
18
|
{% endif %}
|
|
19
19
|
{% if currentPageIndex > 2 %}
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
{% endif %}
|
|
61
61
|
{% if totalPages > 1 and totalPages != currentPageIndex %}
|
|
62
62
|
<li class="ons-pagination__item ons-pagination__item--next">
|
|
63
|
-
<a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">{{ params.next }}</a>
|
|
63
|
+
<a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">{{ params.next | default("Next") }}</a>
|
|
64
64
|
</li>
|
|
65
65
|
{% endif %}
|
|
66
66
|
</ul>
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
</span>
|
|
82
82
|
{% endif %}
|
|
83
83
|
|
|
84
|
-
<div class="ons-panel__body{% if params.iconSize %} ons-
|
|
84
|
+
<div class="ons-panel__body{% if params.iconSize %} ons-icon-margin--{{ params.iconSize }}{% endif %}">{{ (params.body if params else "") | safe }}
|
|
85
85
|
{{ caller() if caller }}
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
@@ -69,42 +69,42 @@
|
|
|
69
69
|
margin-bottom: 0;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
&.ons-
|
|
72
|
+
&.ons-icon-margin--xxxl {
|
|
73
73
|
padding-left: 2.7rem !important;
|
|
74
74
|
|
|
75
75
|
@include mq(m) {
|
|
76
76
|
padding-left: 3.5rem !important;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
&.ons-
|
|
79
|
+
&.ons-icon-margin--xxl {
|
|
80
80
|
padding-left: 2.45rem !important;
|
|
81
81
|
|
|
82
82
|
@include mq(m) {
|
|
83
83
|
padding-left: 2.9rem !important;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
&.ons-
|
|
86
|
+
&.ons-icon-margin--xl {
|
|
87
87
|
padding-left: 2.35rem !important;
|
|
88
88
|
|
|
89
89
|
@include mq(m) {
|
|
90
90
|
padding-left: 2.55rem !important;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
&.ons-
|
|
93
|
+
&.ons-icon-margin--l {
|
|
94
94
|
padding-left: 2.25rem !important;
|
|
95
95
|
|
|
96
96
|
@include mq(m) {
|
|
97
97
|
padding-left: 2.35rem !important;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
&.ons-
|
|
100
|
+
&.ons-icon-margin--m {
|
|
101
101
|
padding-left: 2.05rem !important;
|
|
102
102
|
|
|
103
103
|
@include mq(m) {
|
|
104
104
|
padding-left: 2.2rem !important;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
&.ons-
|
|
107
|
+
&.ons-icon-margin--s {
|
|
108
108
|
padding-left: 1.7rem !important;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
&__icon {
|
|
217
217
|
left: 0;
|
|
218
218
|
padding-left: 1rem;
|
|
219
|
-
.ons-
|
|
219
|
+
.ons-icon {
|
|
220
220
|
fill: var(--ons-color-success) !important;
|
|
221
221
|
margin-top: -15% !important;
|
|
222
222
|
}
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
id="{{ params.id }}"
|
|
23
23
|
name="{{ params.name }}"
|
|
24
24
|
class="ons-input ons-input--select{% if params.classes %} {{ params.classes }}{% endif %}{% if params.error %} ons-input--error{% endif %}"
|
|
25
|
-
{% if params.value %}value="{{ params.value}}" {% endif %}
|
|
26
25
|
{% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ attribute }}{% if value %}="{{ value }}"{% endif %} {% endfor %}{% endif %}
|
|
27
26
|
>
|
|
28
27
|
{% for option in params.options %}
|
|
@@ -30,7 +29,7 @@
|
|
|
30
29
|
{% if option.id %}id="{{ option.id }}" {% endif %}
|
|
31
30
|
{% if option.selected %}selected {% endif %}
|
|
32
31
|
{% if option.disabled %}disabled {% endif %}
|
|
33
|
-
{% if
|
|
32
|
+
{% if option.attributes %}{% for attribute, value in option.attributes %}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
|
|
34
33
|
>
|
|
35
34
|
{{- option.text -}}
|
|
36
35
|
</option>
|
|
@@ -26,7 +26,7 @@ describe('macro: skip-to-content', () => {
|
|
|
26
26
|
}),
|
|
27
27
|
);
|
|
28
28
|
|
|
29
|
-
expect($('.ons-skip-
|
|
29
|
+
expect($('.ons-skip-to-content')[0].tagName).toBe('a');
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
it('has skip link with the provided `url`', async () => {
|
|
@@ -37,7 +37,7 @@ describe('macro: skip-to-content', () => {
|
|
|
37
37
|
}),
|
|
38
38
|
);
|
|
39
39
|
|
|
40
|
-
expect($('.ons-skip-
|
|
40
|
+
expect($('.ons-skip-to-content').attr('href')).toBe('#example-anchor');
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
it('has skip link with the provided `text`', async () => {
|
|
@@ -49,9 +49,23 @@ describe('macro: skip-to-content', () => {
|
|
|
49
49
|
);
|
|
50
50
|
|
|
51
51
|
expect(
|
|
52
|
-
$('.ons-skip-
|
|
52
|
+
$('.ons-skip-to-content')
|
|
53
53
|
.text()
|
|
54
54
|
.trim(),
|
|
55
55
|
).toBe('Skip to the content');
|
|
56
56
|
});
|
|
57
|
+
|
|
58
|
+
it('has skip link with the default text if no text provided`', async () => {
|
|
59
|
+
const $ = cheerio.load(
|
|
60
|
+
renderComponent('skip-to-content', {
|
|
61
|
+
url: '#example-anchor',
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
expect(
|
|
66
|
+
$('.ons-skip-to-content')
|
|
67
|
+
.text()
|
|
68
|
+
.trim(),
|
|
69
|
+
).toBe('Skip to content');
|
|
70
|
+
});
|
|
57
71
|
});
|
|
@@ -2,7 +2,7 @@ import domready from '../../js/domready';
|
|
|
2
2
|
import skipToMain from './skip-to-content';
|
|
3
3
|
|
|
4
4
|
async function initaliseSkipToLink() {
|
|
5
|
-
const links = [...document.querySelectorAll('.ons-skip-
|
|
5
|
+
const links = [...document.querySelectorAll('.ons-skip-to-content')];
|
|
6
6
|
if (links.length) {
|
|
7
7
|
links.forEach(link => {
|
|
8
8
|
skipToMain(link);
|
|
@@ -15,7 +15,7 @@ describe('script: skip-to-content', () => {
|
|
|
15
15
|
it('sets `tabIndex` of target element to -1', async () => {
|
|
16
16
|
await setTestPage('/test', EXAMPLE_SKIP_TO_LINK_TEMPLATE);
|
|
17
17
|
|
|
18
|
-
await page.focus('.ons-skip-
|
|
18
|
+
await page.focus('.ons-skip-to-content');
|
|
19
19
|
await page.keyboard.press('Enter');
|
|
20
20
|
|
|
21
21
|
const targetTabIndex = await page.$eval('#target-element', el => el.tabIndex);
|
|
@@ -25,7 +25,7 @@ describe('script: skip-to-content', () => {
|
|
|
25
25
|
it('removes outline from target element on navigate', async () => {
|
|
26
26
|
await setTestPage('/test', EXAMPLE_SKIP_TO_LINK_TEMPLATE);
|
|
27
27
|
|
|
28
|
-
await page.focus('.ons-skip-
|
|
28
|
+
await page.focus('.ons-skip-to-content');
|
|
29
29
|
await page.keyboard.press('Enter');
|
|
30
30
|
|
|
31
31
|
const targetOutline = await page.$eval('#target-element', el => el.style.outline);
|
|
@@ -35,7 +35,7 @@ describe('script: skip-to-content', () => {
|
|
|
35
35
|
it('focuses target element on navigate', async () => {
|
|
36
36
|
await setTestPage('/test', EXAMPLE_SKIP_TO_LINK_TEMPLATE);
|
|
37
37
|
|
|
38
|
-
await page.focus('.ons-skip-
|
|
38
|
+
await page.focus('.ons-skip-to-content');
|
|
39
39
|
await page.keyboard.press('Enter');
|
|
40
40
|
|
|
41
41
|
const focusedElementId = await page.evaluate(() => document.activeElement.id);
|
|
@@ -96,9 +96,8 @@
|
|
|
96
96
|
<a
|
|
97
97
|
href="{{ action.url }}"
|
|
98
98
|
class="ons-summary__button"
|
|
99
|
-
{% if action.ariaLabel %} aria-label="{{ action.ariaLabel }}"{% endif %}
|
|
100
99
|
{% if action.attributes %}{% for attribute, value in (action.attributes.items() if action.attributes is mapping and action.attributes.items else action.attributes) %}{{attribute}}="{{value}}" {% endfor %}{% endif %}
|
|
101
|
-
>{{ action.text }}</a>
|
|
100
|
+
>{{ action.text }}<span class="ons-u-vh">answer for {{ row.rowTitle }}</span></a>
|
|
102
101
|
{% endfor %}
|
|
103
102
|
</dd>
|
|
104
103
|
{% endif %}
|
|
@@ -49,7 +49,6 @@ const EXAMPLE_SUMMARY_ROWS = {
|
|
|
49
49
|
actions: [
|
|
50
50
|
{
|
|
51
51
|
text: 'Action 1',
|
|
52
|
-
ariaLabel: 'action aria label 1',
|
|
53
52
|
attributes: {
|
|
54
53
|
a: 'abc',
|
|
55
54
|
b: 'def',
|
|
@@ -58,7 +57,6 @@ const EXAMPLE_SUMMARY_ROWS = {
|
|
|
58
57
|
},
|
|
59
58
|
{
|
|
60
59
|
text: 'Action 2',
|
|
61
|
-
ariaLabel: 'action aria label 2',
|
|
62
60
|
url: '#2',
|
|
63
61
|
},
|
|
64
62
|
],
|
|
@@ -149,12 +147,10 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
|
|
|
149
147
|
actions: [
|
|
150
148
|
{
|
|
151
149
|
text: 'Change',
|
|
152
|
-
ariaLabel: 'Change list item',
|
|
153
150
|
url: '#0',
|
|
154
151
|
},
|
|
155
152
|
{
|
|
156
153
|
text: 'Remove',
|
|
157
|
-
ariaLabel: 'Remove list item',
|
|
158
154
|
url: '#0',
|
|
159
155
|
},
|
|
160
156
|
],
|
|
@@ -169,7 +165,6 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
|
|
|
169
165
|
actions: [
|
|
170
166
|
{
|
|
171
167
|
text: 'Change',
|
|
172
|
-
ariaLabel: 'Remove list item',
|
|
173
168
|
url: '#0',
|
|
174
169
|
},
|
|
175
170
|
],
|
|
@@ -184,7 +179,6 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
|
|
|
184
179
|
actions: [
|
|
185
180
|
{
|
|
186
181
|
text: 'Change',
|
|
187
|
-
ariaLabel: 'Change list item',
|
|
188
182
|
url: '#0',
|
|
189
183
|
},
|
|
190
184
|
],
|
|
@@ -203,12 +197,10 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
|
|
|
203
197
|
actions: [
|
|
204
198
|
{
|
|
205
199
|
text: 'Change',
|
|
206
|
-
ariaLabel: 'Change answer',
|
|
207
200
|
url: '#0',
|
|
208
201
|
},
|
|
209
202
|
{
|
|
210
203
|
text: 'Remove',
|
|
211
|
-
ariaLabel: 'Change list item',
|
|
212
204
|
url: '#0',
|
|
213
205
|
},
|
|
214
206
|
],
|
|
@@ -223,7 +215,6 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
|
|
|
223
215
|
actions: [
|
|
224
216
|
{
|
|
225
217
|
text: 'Change',
|
|
226
|
-
ariaLabel: 'Change list item',
|
|
227
218
|
url: '#0',
|
|
228
219
|
},
|
|
229
220
|
],
|
|
@@ -238,7 +229,6 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
|
|
|
238
229
|
actions: [
|
|
239
230
|
{
|
|
240
231
|
text: 'Change',
|
|
241
|
-
ariaLabel: 'Change list item',
|
|
242
232
|
url: '#0',
|
|
243
233
|
},
|
|
244
234
|
],
|
|
@@ -487,25 +477,20 @@ describe('macro: summary', () => {
|
|
|
487
477
|
|
|
488
478
|
expect(
|
|
489
479
|
$('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:first-child').text(),
|
|
490
|
-
).toBe('Action
|
|
480
|
+
).toBe('Action 1answer for row title 2');
|
|
491
481
|
expect(
|
|
492
482
|
$('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:last-child').text(),
|
|
493
|
-
).toBe('Action 2');
|
|
483
|
+
).toBe('Action 2answer for row title 2');
|
|
494
484
|
});
|
|
495
485
|
|
|
496
|
-
it('has the
|
|
486
|
+
it('has the correct visually hidden <span> text', () => {
|
|
497
487
|
const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
|
|
498
488
|
|
|
499
489
|
expect(
|
|
500
|
-
$(
|
|
501
|
-
'
|
|
502
|
-
),
|
|
503
|
-
).toBe('
|
|
504
|
-
expect(
|
|
505
|
-
$('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:last-child').attr(
|
|
506
|
-
'aria-label',
|
|
507
|
-
),
|
|
508
|
-
).toBe('action aria label 2');
|
|
490
|
+
$(
|
|
491
|
+
'.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:first-child .ons-u-vh',
|
|
492
|
+
).text(),
|
|
493
|
+
).toBe('answer for row title 2');
|
|
509
494
|
});
|
|
510
495
|
|
|
511
496
|
it('has custom `attributes`', () => {
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"actions": [
|
|
20
20
|
{
|
|
21
21
|
"text": "Change",
|
|
22
|
-
"ariaLabel": "Change answer",
|
|
23
22
|
"url": "#0"
|
|
24
23
|
}
|
|
25
24
|
]
|
|
@@ -40,7 +39,6 @@
|
|
|
40
39
|
"actions": [
|
|
41
40
|
{
|
|
42
41
|
"text": "Change",
|
|
43
|
-
"ariaLabel": "Change answer",
|
|
44
42
|
"url": "#0"
|
|
45
43
|
}
|
|
46
44
|
]
|
|
@@ -60,7 +58,6 @@
|
|
|
60
58
|
"actions": [
|
|
61
59
|
{
|
|
62
60
|
"text": "Change",
|
|
63
|
-
"ariaLabel": "Change answer",
|
|
64
61
|
"url": "#0"
|
|
65
62
|
}
|
|
66
63
|
]
|
|
@@ -80,7 +77,6 @@
|
|
|
80
77
|
"actions": [
|
|
81
78
|
{
|
|
82
79
|
"text": "Change",
|
|
83
|
-
"ariaLabel": "Change answer",
|
|
84
80
|
"url": "#0"
|
|
85
81
|
}
|
|
86
82
|
]
|