@ons/design-system 65.2.0 → 65.2.2

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.
Files changed (101) hide show
  1. package/README.md +1 -0
  2. package/components/access-code/example-access-code-error.njk +1 -1
  3. package/components/access-code/example-access-code.njk +1 -1
  4. package/components/accordion/example-accordion-open.njk +10 -10
  5. package/components/accordion/example-accordion.njk +1 -1
  6. package/components/address-input/example-address-input-editable.njk +2 -2
  7. package/components/address-input/example-address-input-manual.njk +3 -3
  8. package/components/address-input/example-address-input.njk +2 -2
  9. package/components/autosuggest/_macro.njk +1 -0
  10. package/components/autosuggest/autosuggest.js +2 -1
  11. package/components/autosuggest/autosuggest.spec.js +89 -55
  12. package/components/autosuggest/autosuggest.ui.js +8 -12
  13. package/components/autosuggest/example-autosuggest-country-multiple.njk +4 -3
  14. package/components/autosuggest/example-autosuggest-country.njk +1 -1
  15. package/components/back-link/example-back-link.njk +1 -1
  16. package/components/breadcrumbs/_macro.njk +1 -1
  17. package/components/breadcrumbs/_macro.spec.js +5 -5
  18. package/components/card/example-card-set-with-images.njk +3 -3
  19. package/components/card/example-card-set-with-lists.njk +3 -3
  20. package/components/card/example-card-set.njk +3 -3
  21. package/components/card/example-card.njk +1 -1
  22. package/components/checkboxes/example-checkboxes-disabled.njk +3 -3
  23. package/components/checkboxes/example-checkboxes-error.njk +7 -7
  24. package/components/checkboxes/example-checkboxes-with-descriptions.njk +7 -7
  25. package/components/checkboxes/example-checkboxes-with-hidden-label.njk +9 -9
  26. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +8 -8
  27. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +8 -8
  28. package/components/checkboxes/example-checkboxes-with-revealed-radios-expanded.njk +8 -8
  29. package/components/checkboxes/example-checkboxes-with-revealed-radios.njk +8 -8
  30. package/components/checkboxes/example-checkboxes-with-revealed-select-expanded.njk +4 -4
  31. package/components/checkboxes/example-checkboxes-with-revealed-select.njk +4 -4
  32. package/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.njk +6 -6
  33. package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +6 -6
  34. package/components/checkboxes/example-checkboxes-with-select-all-button.njk +4 -4
  35. package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +6 -6
  36. package/components/checkboxes/example-checkboxes-without-border.njk +3 -3
  37. package/components/checkboxes/example-checkboxes.njk +4 -4
  38. package/components/cookies-banner/_macro.njk +55 -41
  39. package/components/cookies-banner/_macro.spec.js +9 -27
  40. package/components/date-input/example-date-input-error.njk +2 -2
  41. package/components/date-input/example-date-input.njk +1 -1
  42. package/components/details/example-details-with-warning.njk +1 -1
  43. package/components/details/example-details.njk +1 -1
  44. package/components/duration/example-duration-error.njk +6 -6
  45. package/components/duration/example-duration.njk +5 -5
  46. package/components/header/example-header-external-with-service-links.njk +1 -1
  47. package/components/header/example-header-internal.njk +1 -1
  48. package/components/input/example-input-email.njk +1 -1
  49. package/components/input/example-input-number.njk +1 -1
  50. package/components/input/example-input-numeric-values.njk +7 -7
  51. package/components/input/example-input-text-with-character-limit-checker.njk +1 -1
  52. package/components/input/example-input-text-with-description.njk +1 -1
  53. package/components/input/example-input-text.njk +1 -1
  54. package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +6 -6
  55. package/components/mutually-exclusive/example-mutually-exclusive-date-with-error.njk +2 -2
  56. package/components/mutually-exclusive/example-mutually-exclusive-email.njk +2 -2
  57. package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +5 -5
  58. package/components/panel/_macro.spec.js +7 -29
  59. package/components/phase-banner/_macro.njk +1 -1
  60. package/components/radios/example-radios-with-clear-button-expanded.njk +9 -9
  61. package/components/radios/example-radios-with-clear-button.njk +9 -9
  62. package/components/radios/example-radios-with-descriptions.njk +5 -5
  63. package/components/radios/example-radios-with-error.njk +4 -4
  64. package/components/radios/example-radios-with-revealed-checkboxes-expanded.njk +8 -8
  65. package/components/radios/example-radios-with-revealed-checkboxes.njk +8 -8
  66. package/components/radios/example-radios-with-revealed-radios-expanded.njk +9 -9
  67. package/components/radios/example-radios-with-revealed-radios.njk +8 -8
  68. package/components/radios/example-radios-with-revealed-select-expanded.njk +5 -5
  69. package/components/radios/example-radios-with-revealed-select.njk +4 -4
  70. package/components/radios/example-radios-with-revealed-text-input-expanded.njk +9 -9
  71. package/components/radios/example-radios-with-revealed-text-input.njk +9 -9
  72. package/components/radios/example-radios-with-visible-text-input.njk +3 -3
  73. package/components/relationships/example-relationships-error.njk +13 -13
  74. package/components/relationships/example-relationships-you.njk +13 -13
  75. package/components/relationships/example-relationships.njk +13 -13
  76. package/components/select/example-select-with-error.njk +1 -1
  77. package/components/select/example-select-with-inline-label.njk +1 -1
  78. package/components/select/example-select.njk +1 -1
  79. package/components/summary/_macro.njk +2 -2
  80. package/components/summary/_macro.spec.js +28 -25
  81. package/components/summary/example-summary-grouped-total.njk +2 -0
  82. package/components/summary/example-summary-grouped-with-errors.njk +4 -0
  83. package/components/summary/example-summary-grouped.njk +19 -0
  84. package/components/summary/example-summary-household.njk +5 -0
  85. package/components/summary/example-summary-hub.njk +8 -0
  86. package/components/summary/example-summary-multiple.njk +4 -0
  87. package/components/summary/example-summary.njk +4 -0
  88. package/components/textarea/example-textarea-error.njk +1 -1
  89. package/components/upload/example-upload-error.njk +1 -1
  90. package/components/upload/example-upload.njk +1 -1
  91. package/package.json +2 -3
  92. package/scripts/main.es5.js +1 -1
  93. package/scripts/main.js +1 -1
  94. /package/{fonts → scss/fonts}/opensans-bold.woff +0 -0
  95. /package/{fonts → scss/fonts}/opensans-bold.woff2 +0 -0
  96. /package/{fonts → scss/fonts}/opensans-regular.woff +0 -0
  97. /package/{fonts → scss/fonts}/opensans-regular.woff2 +0 -0
  98. /package/{fonts → scss/fonts}/robotomono-bold.woff +0 -0
  99. /package/{fonts → scss/fonts}/robotomono-bold.woff2 +0 -0
  100. /package/{fonts → scss/fonts}/robotomono-regular.woff +0 -0
  101. /package/{fonts → scss/fonts}/robotomono-regular.woff2 +0 -0
@@ -12,14 +12,14 @@
12
12
  "name": "gender-identity",
13
13
  "radios": [
14
14
  {
15
- "id": "yes",
15
+ "id": "yes-example-radio-with-visible-text",
16
16
  "label": {
17
17
  "text": "Yes"
18
18
  },
19
19
  "value": "yes"
20
20
  },
21
21
  {
22
- "id": "no",
22
+ "id": "no-example-radio-with-visible-text",
23
23
  "label": {
24
24
  "text": "No"
25
25
  },
@@ -27,7 +27,7 @@
27
27
  "other": {
28
28
  "open": true,
29
29
  "otherType": "input",
30
- "id": "no-textbox",
30
+ "id": "no-textbox-example-radio-with-visible-text",
31
31
  "name": "no-answer",
32
32
  "label": {
33
33
  "text": "Enter your gender identity"
@@ -62,7 +62,7 @@ layout: ~
62
62
  },
63
63
  "radios": [
64
64
  {
65
- "id": "husband-wife",
65
+ "id": "husband-wife-example-relationships-error",
66
66
  "value": "husband-wife",
67
67
  "label": {
68
68
  "text": "Husband or wife"
@@ -73,7 +73,7 @@ layout: ~
73
73
  }
74
74
  },
75
75
  {
76
- "id": "civil-partner",
76
+ "id": "civil-partner-example-relationships-error",
77
77
  "value": "civil-partner",
78
78
  "label": {
79
79
  "text": "Legally registered civil partner"
@@ -84,7 +84,7 @@ layout: ~
84
84
  }
85
85
  },
86
86
  {
87
- "id": "partner",
87
+ "id": "partner-example-relationships-error",
88
88
  "value": "partner",
89
89
  "label": {
90
90
  "text": "Partner"
@@ -95,7 +95,7 @@ layout: ~
95
95
  }
96
96
  },
97
97
  {
98
- "id": "son-daughter",
98
+ "id": "son-daughter-example-relationships-error",
99
99
  "value": "son-daughter",
100
100
  "label": {
101
101
  "text": "Son or daughter"
@@ -106,7 +106,7 @@ layout: ~
106
106
  }
107
107
  },
108
108
  {
109
- "id": "stepchild",
109
+ "id": "stepchild-example-relationships-error",
110
110
  "value": "stepchild",
111
111
  "label": {
112
112
  "text": "Stepchild"
@@ -117,7 +117,7 @@ layout: ~
117
117
  }
118
118
  },
119
119
  {
120
- "id": "brother-sister",
120
+ "id": "brother-sister-example-relationships-error",
121
121
  "value": "brother-sister",
122
122
  "label": {
123
123
  "text": "Brother or sister"
@@ -128,7 +128,7 @@ layout: ~
128
128
  }
129
129
  },
130
130
  {
131
- "id": "stepbrother-stepsister",
131
+ "id": "stepbrother-stepsister-example-relationships-error",
132
132
  "value": "stepbrother-stepsister",
133
133
  "label": {
134
134
  "text": "Stepbrother or stepsister"
@@ -139,7 +139,7 @@ layout: ~
139
139
  }
140
140
  },
141
141
  {
142
- "id": "mother-father",
142
+ "id": "mother-father-example-relationships-error",
143
143
  "value": "mother-father",
144
144
  "label": {
145
145
  "text": "Mother or father"
@@ -150,7 +150,7 @@ layout: ~
150
150
  }
151
151
  },
152
152
  {
153
- "id": "stepmother-stepfather",
153
+ "id": "stepmother-stepfather-example-relationships-error",
154
154
  "value": "stepmother-stepfather",
155
155
  "label": {
156
156
  "text": "Stepmother or stepfather"
@@ -161,7 +161,7 @@ layout: ~
161
161
  }
162
162
  },
163
163
  {
164
- "id": "grandchild",
164
+ "id": "grandchild-example-relationships-error",
165
165
  "value": "grandchild",
166
166
  "label": {
167
167
  "text": "Grandchild"
@@ -172,7 +172,7 @@ layout: ~
172
172
  }
173
173
  },
174
174
  {
175
- "id": "grandparent",
175
+ "id": "grandparent-example-relationships-error",
176
176
  "value": "grandparent",
177
177
  "label": {
178
178
  "text": "Grandparent"
@@ -183,7 +183,7 @@ layout: ~
183
183
  }
184
184
  },
185
185
  {
186
- "id": "other-relation",
186
+ "id": "other-relation-example-relationships-error",
187
187
  "value": "other-relation",
188
188
  "label": {
189
189
  "text": "Other relation"
@@ -194,7 +194,7 @@ layout: ~
194
194
  }
195
195
  },
196
196
  {
197
- "id": "unrelated",
197
+ "id": "unrelated-example-relationships-error",
198
198
  "value": "unrelated",
199
199
  "label": {
200
200
  "text": "Unrelated",
@@ -38,7 +38,7 @@ layout: ~
38
38
  "dontWrap": true,
39
39
  "radios": [
40
40
  {
41
- "id": "husband-wife",
41
+ "id": "husband-wife-example-relationships-you",
42
42
  "value": "husband-wife",
43
43
  "label": {
44
44
  "text": "Husband or wife"
@@ -49,7 +49,7 @@ layout: ~
49
49
  }
50
50
  },
51
51
  {
52
- "id": "civil-partner",
52
+ "id": "civil-partner-example-relationships-you",
53
53
  "value": "civil-partner",
54
54
  "label": {
55
55
  "text": "Legally registered civil partner"
@@ -60,7 +60,7 @@ layout: ~
60
60
  }
61
61
  },
62
62
  {
63
- "id": "partner",
63
+ "id": "partner-example-relationships-you",
64
64
  "value": "partner",
65
65
  "label": {
66
66
  "text": "Partner"
@@ -71,7 +71,7 @@ layout: ~
71
71
  }
72
72
  },
73
73
  {
74
- "id": "son-daughter",
74
+ "id": "son-daughter-example-relationships-you",
75
75
  "value": "son-daughter",
76
76
  "label": {
77
77
  "text": "Son or daughter"
@@ -82,7 +82,7 @@ layout: ~
82
82
  }
83
83
  },
84
84
  {
85
- "id": "stepchild",
85
+ "id": "stepchild-example-relationships-you",
86
86
  "value": "stepchild",
87
87
  "label": {
88
88
  "text": "Stepchild"
@@ -93,7 +93,7 @@ layout: ~
93
93
  }
94
94
  },
95
95
  {
96
- "id": "brother-sister",
96
+ "id": "brother-sister-example-relationships-you",
97
97
  "value": "brother-sister",
98
98
  "label": {
99
99
  "text": "Brother or sister"
@@ -104,7 +104,7 @@ layout: ~
104
104
  }
105
105
  },
106
106
  {
107
- "id": "stepbrother-stepsister",
107
+ "id": "stepbrother-stepsister-example-relationships-you",
108
108
  "value": "stepbrother-stepsister",
109
109
  "label": {
110
110
  "text": "Stepbrother or stepsister"
@@ -115,7 +115,7 @@ layout: ~
115
115
  }
116
116
  },
117
117
  {
118
- "id": "mother-father",
118
+ "id": "mother-father-example-relationships-you",
119
119
  "value": "mother-father",
120
120
  "label": {
121
121
  "text": "Mother or father"
@@ -126,7 +126,7 @@ layout: ~
126
126
  }
127
127
  },
128
128
  {
129
- "id": "stepmother-stepfather",
129
+ "id": "stepmother-stepfather-example-relationships-you",
130
130
  "value": "stepmother-stepfather",
131
131
  "label": {
132
132
  "text": "Stepmother or stepfather"
@@ -137,7 +137,7 @@ layout: ~
137
137
  }
138
138
  },
139
139
  {
140
- "id": "grandchild",
140
+ "id": "grandchild-example-relationships-you",
141
141
  "value": "grandchild",
142
142
  "label": {
143
143
  "text": "Grandchild"
@@ -148,7 +148,7 @@ layout: ~
148
148
  }
149
149
  },
150
150
  {
151
- "id": "grandparent",
151
+ "id": "grandparent-example-relationships-you",
152
152
  "value": "grandparent",
153
153
  "label": {
154
154
  "text": "Grandparent"
@@ -159,7 +159,7 @@ layout: ~
159
159
  }
160
160
  },
161
161
  {
162
- "id": "other-relation",
162
+ "id": "other-relation-example-relationships-you",
163
163
  "value": "other-relation",
164
164
  "label": {
165
165
  "text": "Other relation"
@@ -170,7 +170,7 @@ layout: ~
170
170
  }
171
171
  },
172
172
  {
173
- "id": "unrelated",
173
+ "id": "unrelated-example-relationships-you",
174
174
  "value": "unrelated",
175
175
  "label": {
176
176
  "text": "Unrelated",
@@ -36,7 +36,7 @@ layout: ~
36
36
  "dontWrap": true,
37
37
  "radios": [
38
38
  {
39
- "id": "husband-wife",
39
+ "id": "husband-wife-example-relationships",
40
40
  "value": "husband-wife",
41
41
  "label": {
42
42
  "text": "Husband or wife"
@@ -47,7 +47,7 @@ layout: ~
47
47
  }
48
48
  },
49
49
  {
50
- "id": "civil-partner",
50
+ "id": "civil-partner-example-relationships",
51
51
  "value": "civil-partner",
52
52
  "label": {
53
53
  "text": "Legally registered civil partner"
@@ -58,7 +58,7 @@ layout: ~
58
58
  }
59
59
  },
60
60
  {
61
- "id": "partner",
61
+ "id": "partner-example-relationships",
62
62
  "value": "partner",
63
63
  "label": {
64
64
  "text": "Partner"
@@ -69,7 +69,7 @@ layout: ~
69
69
  }
70
70
  },
71
71
  {
72
- "id": "son-daughter",
72
+ "id": "son-daughter-example-relationships",
73
73
  "value": "son-daughter",
74
74
  "label": {
75
75
  "text": "Son or daughter"
@@ -80,7 +80,7 @@ layout: ~
80
80
  }
81
81
  },
82
82
  {
83
- "id": "stepchild",
83
+ "id": "stepchild-example-relationships",
84
84
  "value": "stepchild",
85
85
  "label": {
86
86
  "text": "Stepchild"
@@ -91,7 +91,7 @@ layout: ~
91
91
  }
92
92
  },
93
93
  {
94
- "id": "brother-sister",
94
+ "id": "brother-sister-example-relationships",
95
95
  "value": "brother-sister",
96
96
  "label": {
97
97
  "text": "Brother or sister"
@@ -102,7 +102,7 @@ layout: ~
102
102
  }
103
103
  },
104
104
  {
105
- "id": "stepbrother-stepsister",
105
+ "id": "stepbrother-stepsister-example-relationships",
106
106
  "value": "stepbrother-stepsister",
107
107
  "label": {
108
108
  "text": "Stepbrother or stepsister"
@@ -113,7 +113,7 @@ layout: ~
113
113
  }
114
114
  },
115
115
  {
116
- "id": "mother-father",
116
+ "id": "mother-father-example-relationships",
117
117
  "value": "mother-father",
118
118
  "label": {
119
119
  "text": "Mother or father"
@@ -124,7 +124,7 @@ layout: ~
124
124
  }
125
125
  },
126
126
  {
127
- "id": "stepmother-stepfather",
127
+ "id": "stepmother-stepfather-example-relationships",
128
128
  "value": "stepmother-stepfather",
129
129
  "label": {
130
130
  "text": "Stepmother or stepfather"
@@ -135,7 +135,7 @@ layout: ~
135
135
  }
136
136
  },
137
137
  {
138
- "id": "grandchild",
138
+ "id": "grandchild-example-relationships",
139
139
  "value": "grandchild",
140
140
  "label": {
141
141
  "text": "Grandchild"
@@ -146,7 +146,7 @@ layout: ~
146
146
  }
147
147
  },
148
148
  {
149
- "id": "grandparent",
149
+ "id": "grandparent-example-relationships",
150
150
  "value": "grandparent",
151
151
  "label": {
152
152
  "text": "Grandparent"
@@ -157,7 +157,7 @@ layout: ~
157
157
  }
158
158
  },
159
159
  {
160
- "id": "other-relation",
160
+ "id": "other-relation-example-relationships",
161
161
  "value": "other-relation",
162
162
  "label": {
163
163
  "text": "Other relation"
@@ -168,7 +168,7 @@ layout: ~
168
168
  }
169
169
  },
170
170
  {
171
- "id": "unrelated",
171
+ "id": "unrelated-example-relationships",
172
172
  "value": "unrelated",
173
173
  "label": {
174
174
  "text": "Unrelated",
@@ -2,7 +2,7 @@
2
2
 
3
3
  {{
4
4
  onsSelect({
5
- "id": "select",
5
+ "id": "select-example-with-error",
6
6
  "name": "select",
7
7
  "label": {
8
8
  "text": "Question topic"
@@ -1,7 +1,7 @@
1
1
  {% from "components/select/_macro.njk" import onsSelect %}
2
2
  {{
3
3
  onsSelect({
4
- "id": "select",
4
+ "id": "select-example-with-inline-label",
5
5
  "name": "select",
6
6
  "classes": "ons-u-wa--@xxs",
7
7
  "label": {
@@ -1,7 +1,7 @@
1
1
  {% from "components/select/_macro.njk" import onsSelect %}
2
2
  {{
3
3
  onsSelect({
4
- "id": "select",
4
+ "id": "select-example",
5
5
  "name": "select",
6
6
  "label": {
7
7
  "text": "Question topic"
@@ -96,8 +96,8 @@
96
96
  <a
97
97
  href="{{ action.url }}"
98
98
  class="ons-summary__button"
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 %}
100
- >{{ action.text }}<span class="ons-u-vh">answer for {{ row.rowTitle }}</span></a>
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 %}
100
+ ><span class="ons-summary__button-text" aria-hidden="true">{{ action.text }}</span><span class="ons-u-vh">{{ action.visuallyHiddenText }}</span></a>
101
101
  {% endfor %}
102
102
  </dd>
103
103
  {% endif %}
@@ -49,6 +49,7 @@ const EXAMPLE_SUMMARY_ROWS = {
49
49
  actions: [
50
50
  {
51
51
  text: 'Action 1',
52
+ visuallyHiddenText: 'action 1 for row title 2',
52
53
  attributes: {
53
54
  a: 'abc',
54
55
  b: 'def',
@@ -57,6 +58,7 @@ const EXAMPLE_SUMMARY_ROWS = {
57
58
  },
58
59
  {
59
60
  text: 'Action 2',
61
+ visuallyHiddenText: 'action 2 for row title 2',
60
62
  url: '#2',
61
63
  },
62
64
  ],
@@ -147,10 +149,12 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
147
149
  actions: [
148
150
  {
149
151
  text: 'Change',
152
+ visuallyHiddenText: 'change list item',
150
153
  url: '#0',
151
154
  },
152
155
  {
153
156
  text: 'Remove',
157
+ visuallyHiddenText: 'remove list item',
154
158
  url: '#0',
155
159
  },
156
160
  ],
@@ -165,6 +169,7 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
165
169
  actions: [
166
170
  {
167
171
  text: 'Change',
172
+ visuallyHiddenText: 'change list item',
168
173
  url: '#0',
169
174
  },
170
175
  ],
@@ -179,6 +184,7 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
179
184
  actions: [
180
185
  {
181
186
  text: 'Change',
187
+ visuallyHiddenText: 'change list item',
182
188
  url: '#0',
183
189
  },
184
190
  ],
@@ -197,10 +203,12 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
197
203
  actions: [
198
204
  {
199
205
  text: 'Change',
206
+ visuallyHiddenText: 'change answer',
200
207
  url: '#0',
201
208
  },
202
209
  {
203
210
  text: 'Remove',
211
+ visuallyHiddenText: 'remove list item',
204
212
  url: '#0',
205
213
  },
206
214
  ],
@@ -215,6 +223,7 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
215
223
  actions: [
216
224
  {
217
225
  text: 'Change',
226
+ visuallyHiddenText: 'change list item',
218
227
  url: '#0',
219
228
  },
220
229
  ],
@@ -229,6 +238,7 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
229
238
  actions: [
230
239
  {
231
240
  text: 'Change',
241
+ visuallyHiddenText: 'change list item',
232
242
  url: '#0',
233
243
  },
234
244
  ],
@@ -390,11 +400,7 @@ describe('macro: summary', () => {
390
400
  it('displays the `rowTitle` text', () => {
391
401
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
392
402
 
393
- expect(
394
- $('.ons-summary__items .ons-summary__item:nth-of-type(1) .ons-summary__item--text')
395
- .text()
396
- .trim(),
397
- ).toBe('row title 1');
403
+ expect($('.ons-summary__items .ons-summary__item:nth-of-type(1) .ons-summary__item--text').text().trim()).toBe('row title 1');
398
404
  });
399
405
 
400
406
  it('has a custom icon `iconType`', () => {
@@ -430,21 +436,15 @@ describe('macro: summary', () => {
430
436
  it('displays the `valueList` text', () => {
431
437
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
432
438
 
433
- expect(
434
- $('.ons-summary__items .ons-summary__item:nth-of-type(1) dl .ons-summary__values .ons-summary__text')
435
- .text()
436
- .trim(),
437
- ).toBe('row value 1');
439
+ expect($('.ons-summary__items .ons-summary__item:nth-of-type(1) dl .ons-summary__values .ons-summary__text').text().trim()).toBe(
440
+ 'row value 1',
441
+ );
438
442
  });
439
443
 
440
444
  it('displays the `other` text', () => {
441
445
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
442
446
 
443
- expect(
444
- $('.ons-summary__items .ons-summary__item:nth-of-type(1) dl .ons-summary__values ul li')
445
- .text()
446
- .trim(),
447
- ).toBe('other value');
447
+ expect($('.ons-summary__items .ons-summary__item:nth-of-type(1) dl .ons-summary__values ul li').text().trim()).toBe('other value');
448
448
  });
449
449
 
450
450
  it('wraps the `valueList` in a ul if multiple values provided', () => {
@@ -476,11 +476,15 @@ describe('macro: summary', () => {
476
476
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
477
477
 
478
478
  expect(
479
- $('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:first-child').text(),
480
- ).toBe('Action 1answer for row title 2');
479
+ $(
480
+ '.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:first-child .ons-summary__button-text',
481
+ ).text(),
482
+ ).toBe('Action 1');
481
483
  expect(
482
- $('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:last-child').text(),
483
- ).toBe('Action 2answer for row title 2');
484
+ $(
485
+ '.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:last-child .ons-summary__button-text',
486
+ ).text(),
487
+ ).toBe('Action 2');
484
488
  });
485
489
 
486
490
  it('has the correct visually hidden <span> text', () => {
@@ -490,7 +494,10 @@ describe('macro: summary', () => {
490
494
  $(
491
495
  '.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:first-child .ons-u-vh',
492
496
  ).text(),
493
- ).toBe('answer for row title 2');
497
+ ).toBe('action 1 for row title 2');
498
+ expect(
499
+ $('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:last-child .ons-u-vh').text(),
500
+ ).toBe('action 2 for row title 2');
494
501
  });
495
502
 
496
503
  it('has custom `attributes`', () => {
@@ -588,11 +595,7 @@ describe('macro: summary', () => {
588
595
  it('has the correct link `text`', () => {
589
596
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_WITH_NO_ROWS));
590
597
 
591
- expect(
592
- $('.ons-summary__group .ons-summary__link a')
593
- .text()
594
- .trim(),
595
- ).toBe('Summary link');
598
+ expect($('.ons-summary__group .ons-summary__link a').text().trim()).toBe('Summary link');
596
599
  });
597
600
 
598
601
  it('has the correct link `url`', () => {
@@ -19,6 +19,7 @@
19
19
  "actions": [
20
20
  {
21
21
  "text": "Change",
22
+ "visuallyHiddenText": "Change answer",
22
23
  "url": "#0"
23
24
  }
24
25
  ]
@@ -37,6 +38,7 @@
37
38
  "actions": [
38
39
  {
39
40
  "text": "Change",
41
+ "visuallyHiddenText": "Change answer",
40
42
  "url": "#0"
41
43
  }
42
44
  ]
@@ -19,6 +19,7 @@
19
19
  "actions": [
20
20
  {
21
21
  "text": "Change",
22
+ "visuallyHiddenText": "Change answer",
22
23
  "url": "#0"
23
24
  }
24
25
  ]
@@ -39,6 +40,7 @@
39
40
  "actions": [
40
41
  {
41
42
  "text": "Change",
43
+ "visuallyHiddenText": "Change answer",
42
44
  "url": "#0"
43
45
  }
44
46
  ]
@@ -58,6 +60,7 @@
58
60
  "actions": [
59
61
  {
60
62
  "text": "Change",
63
+ "visuallyHiddenText": "Change answer",
61
64
  "url": "#0"
62
65
  }
63
66
  ]
@@ -77,6 +80,7 @@
77
80
  "actions": [
78
81
  {
79
82
  "text": "Change",
83
+ "visuallyHiddenText": "Change answer",
80
84
  "url": "#0"
81
85
  }
82
86
  ]