@ons/design-system 67.2.0 → 68.0.1
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/README.md +6 -0
- package/components/access-code/_macro.njk +1 -1
- package/components/access-code/_macro.spec.js +2 -10
- package/components/access-code/access-code.dom.js +1 -1
- package/components/access-code/access-code.spec.js +2 -2
- package/components/access-code/example-access-code-error.njk +9 -14
- package/components/access-code/example-access-code.njk +3 -5
- package/components/accordion/accordion.js +4 -4
- package/components/address-input/_macro.spec.js +3 -15
- package/components/address-input/autosuggest.address.dom.js +1 -1
- package/components/address-input/autosuggest.address.js +3 -2
- package/components/address-input/autosuggest.address.setter.js +3 -3
- package/components/address-input/autosuggest.address.spec.js +66 -69
- package/components/address-output/_macro.spec.js +6 -30
- package/components/autosuggest/_autosuggest.scss +1 -1
- package/components/autosuggest/autosuggest.dom.js +1 -1
- package/components/autosuggest/autosuggest.helpers.js +1 -1
- package/components/back-to-top/_back-to-top.scss +34 -0
- package/components/back-to-top/_macro.njk +17 -0
- package/components/back-to-top/_macro.spec.js +60 -0
- package/components/back-to-top/back-to-top.dom.js +12 -0
- package/components/back-to-top/back-to-top.js +58 -0
- package/components/back-to-top/back-to-top.spec.js +117 -0
- package/components/back-to-top/example-back-to-top.njk +37 -0
- package/components/back-to-top/example-full-page-back-to-top.njk +192 -0
- package/components/browser-banner/_macro.spec.js +4 -12
- package/components/button/_macro.njk +6 -6
- package/components/button/_macro.spec.js +1 -5
- package/components/button/button.js +7 -8
- package/components/button/button.spec.js +17 -39
- package/components/call-to-action/_macro.spec.js +2 -6
- package/components/card/_macro.njk +25 -25
- package/components/card/_macro.spec.js +10 -34
- package/components/char-check-limit/_macro.njk +1 -1
- package/components/char-check-limit/_macro.spec.js +3 -7
- package/components/char-check-limit/character-check.spec.js +24 -20
- package/components/checkboxes/_checkbox-macro.njk +1 -1
- package/components/checkboxes/_checkbox.scss +0 -3
- package/components/checkboxes/_macro.spec.js +1 -5
- package/components/checkboxes/checkbox-with-autoselect.js +3 -3
- package/components/checkboxes/checkbox-with-fieldset.js +2 -2
- package/components/checkboxes/checkboxes-with-reveal.js +4 -2
- package/components/checkboxes/checkboxes.dom.js +2 -2
- package/components/checkboxes/checkboxes.spec.js +13 -13
- package/components/content-pagination/_macro.spec.js +2 -2
- package/components/cookies-banner/cookies-banner.dom.js +1 -1
- package/components/cookies-banner/cookies-banner.js +1 -1
- package/components/cookies-banner/cookies-banner.spec.js +7 -7
- package/components/date-input/_macro.njk +71 -69
- package/components/date-input/_macro.spec.js +20 -5
- package/components/date-input/example-date-input-double-field.njk +27 -0
- package/components/date-input/example-date-input-single-field.njk +18 -0
- package/components/details/details.spec.js +12 -12
- package/components/details/example-details-with-warning.njk +5 -7
- package/components/document-list/_macro.spec.js +9 -27
- package/components/document-list/document-list.scss +1 -1
- package/components/document-list/example-document-list-downloads.njk +3 -3
- package/components/document-list/example-document-list-search-result-featured.njk +1 -1
- package/components/document-list/example-document-list-search-results.njk +3 -3
- package/components/download-resources/download-resources.js +54 -54
- package/components/download-resources/download-resources.spec.js +3 -1
- package/components/duration/_macro.njk +52 -48
- package/components/duration/_macro.spec.js +112 -4
- package/components/duration/example-duration-error-for-single-field.njk +1 -1
- package/components/duration/example-duration-single-field.njk +24 -0
- package/components/error/_macro.njk +1 -1
- package/components/error/_macro.spec.js +2 -6
- package/components/feedback/_macro.njk +1 -1
- package/components/feedback/_macro.spec.js +4 -20
- package/components/field/_field-group.scss +3 -4
- package/components/field/_macro.spec.js +1 -3
- package/components/fieldset/_fieldset.scss +1 -2
- package/components/fieldset/_macro.spec.js +3 -9
- package/components/footer/_footer.scss +8 -0
- package/components/footer/_macro.njk +8 -7
- package/components/footer/_macro.spec.js +14 -2
- package/components/header/_macro.njk +1 -1
- package/components/header/_macro.spec.js +1 -1
- package/components/helpers/grid.njk +15 -15
- package/components/icon/_macro.njk +17 -13
- package/components/icon/_macro.spec.js +8 -16
- package/components/image/_macro.spec.js +1 -5
- package/components/input/_macro.njk +22 -23
- package/components/input/_macro.spec.js +1 -1
- package/components/input/character-check.dom.js +1 -1
- package/components/input/input.spec.js +1 -4
- package/components/label/_label.scss +1 -0
- package/components/label/_macro.njk +3 -3
- package/components/label/_macro.spec.js +4 -13
- package/components/list/_macro.spec.js +4 -12
- package/components/message/_macro.njk +17 -17
- package/components/message/_macro.spec.js +9 -33
- package/components/message-list/_macro.spec.js +7 -39
- package/components/metadata/_macro.njk +10 -10
- package/components/modal/_macro.spec.js +3 -9
- package/components/modal/modal.dom.js +1 -1
- package/components/modal/modal.spec.js +5 -5
- package/components/multiple-input-fields/_macro.njk +49 -0
- package/components/mutually-exclusive/_macro.spec.js +2 -10
- package/components/mutually-exclusive/mutually-exclusive.checkboxes.spec.js +26 -26
- package/components/mutually-exclusive/mutually-exclusive.date.spec.js +128 -14
- package/components/mutually-exclusive/mutually-exclusive.dom.js +1 -1
- package/components/mutually-exclusive/mutually-exclusive.duration.spec.js +129 -8
- package/components/mutually-exclusive/mutually-exclusive.email.spec.js +7 -7
- package/components/mutually-exclusive/mutually-exclusive.js +13 -13
- package/components/mutually-exclusive/mutually-exclusive.multiple-options.checkboxes.spec.js +29 -29
- package/components/mutually-exclusive/mutually-exclusive.number.spec.js +7 -7
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +8 -8
- package/components/navigation/navigation.spec.js +0 -2
- package/components/pagination/_macro.spec.js +11 -53
- package/components/panel/_macro.njk +17 -17
- package/components/panel/_macro.spec.js +25 -25
- package/components/panel/_panel.scss +10 -9
- package/components/panel/example-panel-bare.njk +3 -4
- package/components/panel/example-panel-with-announcement.njk +6 -10
- package/components/panel/example-panel-with-error-summary.njk +2 -2
- package/components/panel/example-panel-with-information.njk +0 -1
- package/components/panel/example-panel-with-success-message.njk +1 -1
- package/components/panel/example-panel-with-warning.njk +2 -3
- package/components/password/password.dom.js +1 -1
- package/components/phase-banner/_macro.spec.js +3 -9
- package/components/question/_macro.njk +1 -1
- package/components/question/_macro.spec.js +5 -19
- package/components/question/_question.scss +1 -4
- package/components/question/example-question-interviewer-note.njk +1 -1
- package/components/quote/_macro.spec.js +2 -10
- package/components/radios/clear-radios.js +3 -3
- package/components/radios/radio-with-fieldset.js +4 -4
- package/components/radios/radios.dom.js +1 -1
- package/components/radios/radios.spec.js +26 -26
- package/components/related-content/_macro.spec.js +2 -4
- package/components/related-content/_section-macro.spec.js +2 -8
- package/components/relationships/example-relationships-error.njk +16 -18
- package/components/relationships/relationships.dom.js +1 -1
- package/components/relationships/relationships.js +2 -2
- package/components/reply/_macro.spec.js +3 -3
- package/components/reply/reply.dom.js +1 -1
- package/components/reply/reply.spec.js +3 -3
- package/components/section-navigation/_macro.njk +12 -12
- package/components/section-navigation/_macro.spec.js +13 -21
- package/components/select/_macro.spec.js +6 -6
- package/components/share-page/_macro.spec.js +6 -14
- package/components/skip-to-content/_macro.spec.js +3 -11
- package/components/skip-to-content/skip-to-content.dom.js +1 -1
- package/components/skip-to-content/skip-to-content.js +1 -1
- package/components/skip-to-content/skip-to-content.spec.js +2 -2
- package/components/status/_macro.njk +2 -2
- package/components/status/_macro.spec.js +5 -9
- package/components/status/example-status-dead.njk +1 -1
- package/components/status/example-status-error.njk +1 -1
- package/components/status/example-status-pending.njk +1 -1
- package/components/status/example-status-small.njk +1 -1
- package/components/status/example-status-success.njk +1 -1
- package/components/summary/_macro.njk +7 -8
- package/components/summary/_macro.spec.js +27 -9
- package/components/table/_macro.spec.js +6 -10
- package/components/table/scrollable-table.dom.js +1 -1
- package/components/table/scrollable-table.js +1 -1
- package/components/table/sortable-table.js +4 -4
- package/components/table/table.spec.js +21 -17
- package/components/table-of-contents/_macro.njk +31 -31
- package/components/table-of-contents/_macro.spec.js +3 -11
- package/components/table-of-contents/toc.dom.js +1 -1
- package/components/table-of-contents/toc.spec.js +36 -32
- package/components/tabs/example-tabs-details.njk +1 -1
- package/components/tabs/tabs.dom.js +1 -1
- package/components/tabs/tabs.js +8 -8
- package/components/text-indent/_macro.spec.js +2 -6
- package/components/textarea/textarea.dom.js +1 -1
- package/components/textarea/textarea.spec.js +8 -8
- package/components/timeout-modal/_macro.spec.js +1 -3
- package/components/timeout-modal/timeout-modal.dom.js +1 -1
- package/components/timeout-modal/timeout-modal.spec.js +10 -10
- package/components/timeout-panel/_macro.njk +16 -17
- package/components/timeout-panel/_macro.spec.js +1 -1
- package/components/timeout-panel/timeout-panel.dom.js +1 -1
- package/components/timeout-panel/timeout-panel.spec.js +8 -8
- package/components/video/_macro.spec.js +1 -5
- package/components/video/video.dom.js +1 -1
- package/components/video/video.spec.js +16 -12
- package/css/main.css +1 -1
- package/favicons/safari-pinned-tab.svg +23 -23
- package/js/analytics.js +15 -14
- package/js/cookies-settings.dom.js +1 -1
- package/js/cookies-settings.spec.js +19 -19
- package/js/domready.js +1 -1
- package/js/fetch.js +1 -1
- package/js/inpagelink.js +3 -3
- package/js/main.js +1 -0
- package/js/print-button.js +1 -1
- package/js/timeout.js +1 -1
- package/package.json +2 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_typography.scss +8 -2
- package/scss/main.scss +1 -0
- package/scss/overrides/hcm.scss +8 -1
- package/scss/vars/_colors.scss +2 -1
- package/components/date-field-input/_macro.njk +0 -86
package/components/mutually-exclusive/mutually-exclusive.multiple-options.checkboxes.spec.js
CHANGED
|
@@ -87,22 +87,22 @@ describe('script: mutually-exclusive', () => {
|
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
it('then the mutually exclusive option is checked', async () => {
|
|
90
|
-
const isChecked = await page.$eval('#dont-know', node => node.checked);
|
|
90
|
+
const isChecked = await page.$eval('#dont-know', (node) => node.checked);
|
|
91
91
|
expect(isChecked).toBe(true);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
it('then the checkboxes are not checked', async () => {
|
|
95
|
-
expect(await page.$eval('#gas', node => node.checked)).toBe(false);
|
|
96
|
-
expect(await page.$eval('#electric', node => node.checked)).toBe(false);
|
|
97
|
-
expect(await page.$eval('#solid-fuel', node => node.checked)).toBe(false);
|
|
98
|
-
expect(await page.$eval('#other-fuel', node => node.checked)).toBe(false);
|
|
99
|
-
expect(await page.$eval('#other-fuel-textbox', node => node.value)).toBe('');
|
|
95
|
+
expect(await page.$eval('#gas', (node) => node.checked)).toBe(false);
|
|
96
|
+
expect(await page.$eval('#electric', (node) => node.checked)).toBe(false);
|
|
97
|
+
expect(await page.$eval('#solid-fuel', (node) => node.checked)).toBe(false);
|
|
98
|
+
expect(await page.$eval('#other-fuel', (node) => node.checked)).toBe(false);
|
|
99
|
+
expect(await page.$eval('#other-fuel-textbox', (node) => node.value)).toBe('');
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
it('then the aria-live message should reflect the removed non exclusive options', async () => {
|
|
103
103
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
104
104
|
|
|
105
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
105
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
106
106
|
expect(alertText).toBe('Gas deselected. Electric deselected. Other deselected. Please specify deselected.');
|
|
107
107
|
});
|
|
108
108
|
});
|
|
@@ -121,21 +121,21 @@ describe('script: mutually-exclusive', () => {
|
|
|
121
121
|
});
|
|
122
122
|
|
|
123
123
|
it('then the expected checkboxes are checked', async () => {
|
|
124
|
-
expect(await page.$eval('#gas', node => node.checked)).toBe(true);
|
|
125
|
-
expect(await page.$eval('#electric', node => node.checked)).toBe(true);
|
|
126
|
-
expect(await page.$eval('#solid-fuel', node => node.checked)).toBe(false);
|
|
127
|
-
expect(await page.$eval('#other-fuel', node => node.checked)).toBe(true);
|
|
124
|
+
expect(await page.$eval('#gas', (node) => node.checked)).toBe(true);
|
|
125
|
+
expect(await page.$eval('#electric', (node) => node.checked)).toBe(true);
|
|
126
|
+
expect(await page.$eval('#solid-fuel', (node) => node.checked)).toBe(false);
|
|
127
|
+
expect(await page.$eval('#other-fuel', (node) => node.checked)).toBe(true);
|
|
128
128
|
});
|
|
129
129
|
|
|
130
130
|
it('then the exclusive options should not be checked', async () => {
|
|
131
|
-
expect(await page.$eval('#no-central-heating', node => node.checked)).toBe(false);
|
|
132
|
-
expect(await page.$eval('#dont-know', node => node.checked)).toBe(false);
|
|
131
|
+
expect(await page.$eval('#no-central-heating', (node) => node.checked)).toBe(false);
|
|
132
|
+
expect(await page.$eval('#dont-know', (node) => node.checked)).toBe(false);
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
it('then the aria-live message should reflect the removed exclusive option', async () => {
|
|
136
136
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
137
137
|
|
|
138
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
138
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
139
139
|
expect(alertText).toBe('Dont know deselected.');
|
|
140
140
|
});
|
|
141
141
|
|
|
@@ -147,7 +147,7 @@ describe('script: mutually-exclusive', () => {
|
|
|
147
147
|
it('the aria-live message should not be updated', async () => {
|
|
148
148
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
149
149
|
|
|
150
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
150
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
151
151
|
expect(alertText).toBe('Dont know deselected.');
|
|
152
152
|
});
|
|
153
153
|
});
|
|
@@ -163,21 +163,21 @@ describe('script: mutually-exclusive', () => {
|
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
it('then the expected checkboxes are checked', async () => {
|
|
166
|
-
expect(await page.$eval('#gas', node => node.checked)).toBe(true);
|
|
167
|
-
expect(await page.$eval('#electric', node => node.checked)).toBe(true);
|
|
168
|
-
expect(await page.$eval('#solid-fuel', node => node.checked)).toBe(false);
|
|
169
|
-
expect(await page.$eval('#other-fuel', node => node.checked)).toBe(true);
|
|
166
|
+
expect(await page.$eval('#gas', (node) => node.checked)).toBe(true);
|
|
167
|
+
expect(await page.$eval('#electric', (node) => node.checked)).toBe(true);
|
|
168
|
+
expect(await page.$eval('#solid-fuel', (node) => node.checked)).toBe(false);
|
|
169
|
+
expect(await page.$eval('#other-fuel', (node) => node.checked)).toBe(true);
|
|
170
170
|
});
|
|
171
171
|
|
|
172
172
|
it('then the exclusive options should not be checked', async () => {
|
|
173
|
-
expect(await page.$eval('#no-central-heating', node => node.checked)).toBe(false);
|
|
174
|
-
expect(await page.$eval('#dont-know', node => node.checked)).toBe(false);
|
|
173
|
+
expect(await page.$eval('#no-central-heating', (node) => node.checked)).toBe(false);
|
|
174
|
+
expect(await page.$eval('#dont-know', (node) => node.checked)).toBe(false);
|
|
175
175
|
});
|
|
176
176
|
|
|
177
177
|
it('then the aria-live message should say nothing', async () => {
|
|
178
178
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
179
179
|
|
|
180
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
180
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
181
181
|
expect(alertText).toBe('');
|
|
182
182
|
});
|
|
183
183
|
});
|
|
@@ -190,21 +190,21 @@ describe('script: mutually-exclusive', () => {
|
|
|
190
190
|
});
|
|
191
191
|
|
|
192
192
|
it('then the expected checkboxes are not checked', async () => {
|
|
193
|
-
expect(await page.$eval('#gas', node => node.checked)).toBe(false);
|
|
194
|
-
expect(await page.$eval('#electric', node => node.checked)).toBe(false);
|
|
195
|
-
expect(await page.$eval('#solid-fuel', node => node.checked)).toBe(false);
|
|
196
|
-
expect(await page.$eval('#other-fuel', node => node.checked)).toBe(false);
|
|
193
|
+
expect(await page.$eval('#gas', (node) => node.checked)).toBe(false);
|
|
194
|
+
expect(await page.$eval('#electric', (node) => node.checked)).toBe(false);
|
|
195
|
+
expect(await page.$eval('#solid-fuel', (node) => node.checked)).toBe(false);
|
|
196
|
+
expect(await page.$eval('#other-fuel', (node) => node.checked)).toBe(false);
|
|
197
197
|
});
|
|
198
198
|
|
|
199
199
|
it('then the exclusive option should be checked', async () => {
|
|
200
|
-
expect(await page.$eval('#no-central-heating', node => node.checked)).toBe(false);
|
|
201
|
-
expect(await page.$eval('#dont-know', node => node.checked)).toBe(true);
|
|
200
|
+
expect(await page.$eval('#no-central-heating', (node) => node.checked)).toBe(false);
|
|
201
|
+
expect(await page.$eval('#dont-know', (node) => node.checked)).toBe(true);
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
it('then the aria-live message should say nothing', async () => {
|
|
205
205
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
206
206
|
|
|
207
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
207
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
208
208
|
expect(alertText).toBe('');
|
|
209
209
|
});
|
|
210
210
|
});
|
|
@@ -53,19 +53,19 @@ describe('script: mutually-exclusive', () => {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
it('then the mutually exclusive option should be checked', async () => {
|
|
56
|
-
const isChecked = await page.$eval('#currency-exclusive-option', node => node.checked);
|
|
56
|
+
const isChecked = await page.$eval('#currency-exclusive-option', (node) => node.checked);
|
|
57
57
|
expect(isChecked).toBe(true);
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
it('then the number input should be cleared', async () => {
|
|
61
|
-
const inputValue = await page.$eval('#currency', node => node.value);
|
|
61
|
+
const inputValue = await page.$eval('#currency', (node) => node.value);
|
|
62
62
|
expect(inputValue).toBe('');
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
it('then the aria alert should tell the user that the number input has been cleared', async () => {
|
|
66
66
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
67
67
|
|
|
68
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
68
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
69
69
|
expect(alertText).toBe('Gross annual income cleared.');
|
|
70
70
|
});
|
|
71
71
|
});
|
|
@@ -82,14 +82,14 @@ describe('script: mutually-exclusive', () => {
|
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
it('then the exclusive option should be unchecked', async () => {
|
|
85
|
-
const isChecked = await page.$eval('#currency-exclusive-option', node => node.checked);
|
|
85
|
+
const isChecked = await page.$eval('#currency-exclusive-option', (node) => node.checked);
|
|
86
86
|
expect(isChecked).toBe(false);
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
it('then the aria alert should tell the user that the exclusive option has been unchecked', async () => {
|
|
90
90
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
91
91
|
|
|
92
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
92
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
93
93
|
expect(alertText).toBe('I prefer not to say deselected.');
|
|
94
94
|
});
|
|
95
95
|
});
|
|
@@ -104,7 +104,7 @@ describe('script: mutually-exclusive', () => {
|
|
|
104
104
|
it('then the aria alert shouldnt say anything', async () => {
|
|
105
105
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
106
106
|
|
|
107
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
107
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
108
108
|
expect(alertText).toBe('');
|
|
109
109
|
});
|
|
110
110
|
});
|
|
@@ -117,7 +117,7 @@ describe('script: mutually-exclusive', () => {
|
|
|
117
117
|
it('then the aria alert shouldnt say anything', async () => {
|
|
118
118
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
119
119
|
|
|
120
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
120
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
121
121
|
expect(alertText).toBe('');
|
|
122
122
|
});
|
|
123
123
|
});
|
|
@@ -53,24 +53,24 @@ describe('script: mutually-exclusive', () => {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
it('then the mutually exclusive option should be checked', async () => {
|
|
56
|
-
const isChecked = await page.$eval('#feedback-exclusive-option', node => node.checked);
|
|
56
|
+
const isChecked = await page.$eval('#feedback-exclusive-option', (node) => node.checked);
|
|
57
57
|
expect(isChecked).toBe(true);
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
it('then the textarea should be cleared', async () => {
|
|
61
|
-
const textareaValue = await page.$eval('#feedback', node => node.value);
|
|
61
|
+
const textareaValue = await page.$eval('#feedback', (node) => node.value);
|
|
62
62
|
expect(textareaValue).toBe('');
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
it('then the characters remaining readout should be reset', async () => {
|
|
66
|
-
const limitText = await page.$eval('#feedback-lim', node => node.textContent);
|
|
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
|
|
|
70
70
|
it('then the aria alert should tell the user that the textarea has been cleared', async () => {
|
|
71
71
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
72
72
|
|
|
73
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
73
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
74
74
|
expect(alertText).toBe('Enter your feedback cleared.');
|
|
75
75
|
});
|
|
76
76
|
});
|
|
@@ -87,14 +87,14 @@ describe('script: mutually-exclusive', () => {
|
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
it('then the exclusive option should be unchecked', async () => {
|
|
90
|
-
const isChecked = await page.$eval('#feedback-exclusive-option', node => node.checked);
|
|
90
|
+
const isChecked = await page.$eval('#feedback-exclusive-option', (node) => node.checked);
|
|
91
91
|
expect(isChecked).toBe(false);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
it('then the aria alert should tell the user that the exclusive option has been unchecked', async () => {
|
|
95
95
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
96
96
|
|
|
97
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
97
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
98
98
|
expect(alertText).toBe('I dont want to provide feedback deselected.');
|
|
99
99
|
});
|
|
100
100
|
});
|
|
@@ -109,7 +109,7 @@ describe('script: mutually-exclusive', () => {
|
|
|
109
109
|
it('then the aria alert shouldnt say anything', async () => {
|
|
110
110
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
111
111
|
|
|
112
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
112
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
113
113
|
expect(alertText).toBe('');
|
|
114
114
|
});
|
|
115
115
|
});
|
|
@@ -122,7 +122,7 @@ describe('script: mutually-exclusive', () => {
|
|
|
122
122
|
it('then the aria alert shouldnt say anything', async () => {
|
|
123
123
|
await page.waitForTimeout(SCREEN_READER_TIMEOUT_DELAY);
|
|
124
124
|
|
|
125
|
-
const alertText = await page.$eval('.ons-js-exclusive-alert', node => node.textContent);
|
|
125
|
+
const alertText = await page.$eval('.ons-js-exclusive-alert', (node) => node.textContent);
|
|
126
126
|
expect(alertText).toBe('');
|
|
127
127
|
});
|
|
128
128
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as cheerio from 'cheerio';
|
|
4
4
|
|
|
5
5
|
import axe from '../../tests/helpers/axe';
|
|
6
|
-
import { renderComponent
|
|
6
|
+
import { renderComponent } from '../../tests/helpers/rendering';
|
|
7
7
|
|
|
8
8
|
const PAGINATION_PREV_NEXT_LABELS = {
|
|
9
9
|
previous: 'Previous page',
|
|
@@ -70,11 +70,7 @@ describe('macro: pagination', () => {
|
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
it('renders element indicating position within pagination', () => {
|
|
73
|
-
expect(
|
|
74
|
-
$('.ons-pagination__position')
|
|
75
|
-
.text()
|
|
76
|
-
.trim(),
|
|
77
|
-
).toBe('Page 1 of 1');
|
|
73
|
+
expect($('.ons-pagination__position').text().trim()).toBe('Page 1 of 1');
|
|
78
74
|
});
|
|
79
75
|
|
|
80
76
|
it('has a single list item', () => {
|
|
@@ -102,11 +98,7 @@ describe('macro: pagination', () => {
|
|
|
102
98
|
});
|
|
103
99
|
|
|
104
100
|
it('renders element indicating position within pagination', () => {
|
|
105
|
-
expect(
|
|
106
|
-
$('.ons-pagination__position')
|
|
107
|
-
.text()
|
|
108
|
-
.trim(),
|
|
109
|
-
).toBe('Page 1 of 2');
|
|
101
|
+
expect($('.ons-pagination__position').text().trim()).toBe('Page 1 of 2');
|
|
110
102
|
});
|
|
111
103
|
|
|
112
104
|
it('has a 3 list items ("1", "2", "Next page")', () => {
|
|
@@ -136,11 +128,7 @@ describe('macro: pagination', () => {
|
|
|
136
128
|
});
|
|
137
129
|
|
|
138
130
|
it('renders element indicating position within pagination', () => {
|
|
139
|
-
expect(
|
|
140
|
-
$('.ons-pagination__position')
|
|
141
|
-
.text()
|
|
142
|
-
.trim(),
|
|
143
|
-
).toBe('Page 2 of 2');
|
|
131
|
+
expect($('.ons-pagination__position').text().trim()).toBe('Page 2 of 2');
|
|
144
132
|
});
|
|
145
133
|
|
|
146
134
|
it('has a 3 list items ("Previous page", "1", "2")', () => {
|
|
@@ -170,11 +158,7 @@ describe('macro: pagination', () => {
|
|
|
170
158
|
});
|
|
171
159
|
|
|
172
160
|
it('renders element indicating position within pagination', () => {
|
|
173
|
-
expect(
|
|
174
|
-
$('.ons-pagination__position')
|
|
175
|
-
.text()
|
|
176
|
-
.trim(),
|
|
177
|
-
).toBe('Page 2 of 3');
|
|
161
|
+
expect($('.ons-pagination__position').text().trim()).toBe('Page 2 of 3');
|
|
178
162
|
});
|
|
179
163
|
|
|
180
164
|
it('has a 5 list items ("Previous page", "1", "2", "3", "Next page")', () => {
|
|
@@ -206,11 +190,7 @@ describe('macro: pagination', () => {
|
|
|
206
190
|
});
|
|
207
191
|
|
|
208
192
|
it('renders element indicating position within pagination', () => {
|
|
209
|
-
expect(
|
|
210
|
-
$('.ons-pagination__position')
|
|
211
|
-
.text()
|
|
212
|
-
.trim(),
|
|
213
|
-
).toBe('Page 2 of 5');
|
|
193
|
+
expect($('.ons-pagination__position').text().trim()).toBe('Page 2 of 5');
|
|
214
194
|
});
|
|
215
195
|
|
|
216
196
|
it('has a 7 list items ("Previous page", "1", "2", "3", "4", "5", "Next page")', () => {
|
|
@@ -244,11 +224,7 @@ describe('macro: pagination', () => {
|
|
|
244
224
|
});
|
|
245
225
|
|
|
246
226
|
it('renders element indicating position within pagination', () => {
|
|
247
|
-
expect(
|
|
248
|
-
$('.ons-pagination__position')
|
|
249
|
-
.text()
|
|
250
|
-
.trim(),
|
|
251
|
-
).toBe('Page 2 of 6');
|
|
227
|
+
expect($('.ons-pagination__position').text().trim()).toBe('Page 2 of 6');
|
|
252
228
|
});
|
|
253
229
|
|
|
254
230
|
it('has 7 list items ("Previous page", "1", "2", "3", "...", "6", "Next page")', () => {
|
|
@@ -294,11 +270,7 @@ describe('macro: pagination', () => {
|
|
|
294
270
|
});
|
|
295
271
|
|
|
296
272
|
it('renders element indicating position within pagination', () => {
|
|
297
|
-
expect(
|
|
298
|
-
$('.ons-pagination__position')
|
|
299
|
-
.text()
|
|
300
|
-
.trim(),
|
|
301
|
-
).toBe('Page 5 of 11');
|
|
273
|
+
expect($('.ons-pagination__position').text().trim()).toBe('Page 5 of 11');
|
|
302
274
|
});
|
|
303
275
|
|
|
304
276
|
it('has a 9 list items ("Previous page", "1", "...", "4", "5", "6", "...", "11", "Next page")', () => {
|
|
@@ -346,11 +318,7 @@ describe('macro: pagination', () => {
|
|
|
346
318
|
});
|
|
347
319
|
|
|
348
320
|
it('renders element indicating position within pagination', () => {
|
|
349
|
-
expect(
|
|
350
|
-
$('.ons-pagination__position')
|
|
351
|
-
.text()
|
|
352
|
-
.trim(),
|
|
353
|
-
).toBe('Page 10 of 11');
|
|
321
|
+
expect($('.ons-pagination__position').text().trim()).toBe('Page 10 of 11');
|
|
354
322
|
});
|
|
355
323
|
|
|
356
324
|
it('has a 7 list items ("Previous page", "1", "...", "9", "10", "11", "Next page")', () => {
|
|
@@ -371,12 +339,7 @@ function assertIsCurrentPage(pageItem, url, label, text) {
|
|
|
371
339
|
expect(pageItem.find('.ons-pagination__link').attr('href')).toBe(url);
|
|
372
340
|
expect(pageItem.find('.ons-pagination__link').attr('aria-current')).toBe('true');
|
|
373
341
|
expect(pageItem.find('.ons-pagination__link').attr('aria-label')).toBe(label);
|
|
374
|
-
expect(
|
|
375
|
-
pageItem
|
|
376
|
-
.find('.ons-pagination__link')
|
|
377
|
-
.text()
|
|
378
|
-
.trim(),
|
|
379
|
-
).toBe(text);
|
|
342
|
+
expect(pageItem.find('.ons-pagination__link').text().trim()).toBe(text);
|
|
380
343
|
}
|
|
381
344
|
|
|
382
345
|
function assertIsOtherPage(pageItem, url, label, text) {
|
|
@@ -384,12 +347,7 @@ function assertIsOtherPage(pageItem, url, label, text) {
|
|
|
384
347
|
expect(pageItem.find('.ons-pagination__link').attr('href')).toBe(url);
|
|
385
348
|
expect(pageItem.find('.ons-pagination__link').attr('aria-current')).toBeUndefined();
|
|
386
349
|
expect(pageItem.find('.ons-pagination__link').attr('aria-label')).toBe(label);
|
|
387
|
-
expect(
|
|
388
|
-
pageItem
|
|
389
|
-
.find('.ons-pagination__link')
|
|
390
|
-
.text()
|
|
391
|
-
.trim(),
|
|
392
|
-
).toBe(text);
|
|
350
|
+
expect(pageItem.find('.ons-pagination__link').text().trim()).toBe(text);
|
|
393
351
|
}
|
|
394
352
|
|
|
395
353
|
function assertIsPreviousPage(pageItem, url, label, text) {
|
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
{% set classes = ' ' + params.classes %}
|
|
5
5
|
{% endif %}
|
|
6
6
|
|
|
7
|
-
{% if params
|
|
7
|
+
{% if params.title is not defined and params.variant != "bare" %}
|
|
8
8
|
{% set noTitleClass = ' ons-panel--no-title' %}
|
|
9
9
|
{% endif %}
|
|
10
10
|
|
|
11
|
-
{% if params.
|
|
12
|
-
{% set
|
|
11
|
+
{% if params.variant %}
|
|
12
|
+
{% set variantClass = ' ons-panel--' + params.variant %}
|
|
13
13
|
{% else %}
|
|
14
|
-
{% set
|
|
14
|
+
{% set variantClass = ' ons-panel--info' %}
|
|
15
15
|
{% endif %}
|
|
16
16
|
|
|
17
|
-
{% if params.
|
|
17
|
+
{% if params.variant == "warn-branded" %}
|
|
18
18
|
{% set containerClass = 'ons-branded-warning' %}
|
|
19
19
|
{% endif %}
|
|
20
20
|
|
|
21
|
-
{% if params.
|
|
21
|
+
{% if params.variant == "announcement" %}
|
|
22
22
|
{% set containerClass = 'ons-announcement' %}
|
|
23
23
|
{% endif %}
|
|
24
24
|
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
{% set spaciousClass = ' ons-panel--spacious' %}
|
|
27
27
|
{% endif %}
|
|
28
28
|
|
|
29
|
-
{% if params.
|
|
29
|
+
{% if params.variant == "warn-branded" or params.variant == "announcement" %}
|
|
30
30
|
<div class="{{containerClass}}">
|
|
31
31
|
<div class="ons-container">
|
|
32
32
|
{% endif %}
|
|
33
33
|
|
|
34
|
-
<div {% if (params.
|
|
34
|
+
<div {% if (params.variant == 'error' and params.title) or params.variant == 'success' %}aria-labelledby="alert" role="alert" tabindex="-1" {% if not isDesignSystemExample %}autofocus="autofocus" {% endif %}{% endif %}class="ons-panel{{ variantClass }}{{ iconClass }}{{ noTitleClass }}{{ spaciousClass }}{{ classes }}"{% if params and params.attributes %}{% for attribute, value in (params.attributes.items() if params and params.attributes is mapping and params.attributes.items else params.attributes) %}{{attribute}}="{{value}}" {% endfor %}{% endif %}{% if params and params.id %} id="{{params.id}}"{% endif %}>
|
|
35
35
|
|
|
36
|
-
{% if params.
|
|
36
|
+
{% if params.variant == "warn" or params.variant == "warn-branded" %}
|
|
37
37
|
<span class="ons-panel__icon" aria-hidden="true">!</span>
|
|
38
38
|
<span class="ons-panel__assistive-text ons-u-vh">{{ params.assistiveTextPrefix | default("Warning: ") }}</span>
|
|
39
39
|
{% endif %}
|
|
40
40
|
|
|
41
|
-
{% if params.
|
|
41
|
+
{% if params.variant == "announcement" %}
|
|
42
42
|
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
43
43
|
<span class="ons-panel__icon" aria-hidden="true">
|
|
44
44
|
{{-
|
|
@@ -51,21 +51,21 @@
|
|
|
51
51
|
{% endif %}
|
|
52
52
|
|
|
53
53
|
{% if params.title %}
|
|
54
|
-
{% if params.
|
|
54
|
+
{% if params.variant == 'error' %}
|
|
55
55
|
{% set defaultTitleTag = "h2" %}
|
|
56
56
|
{% else %}
|
|
57
57
|
{% set defaultTitleTag = "div" %}
|
|
58
58
|
{% endif %}
|
|
59
59
|
{% set titleTag = params.titleTag | default(defaultTitleTag) %}
|
|
60
60
|
<div class="ons-panel__header">
|
|
61
|
-
<{{ titleTag }} id="alert"{% if params.
|
|
61
|
+
<{{ titleTag }} id="alert"{% if params.variant %} data-qa="{{ params.variant }}-header"{% endif %} class="ons-panel__title ons-u-fs-r--b">{{ params.title | safe }}</{{ titleTag }}>
|
|
62
62
|
</div>
|
|
63
63
|
{% else %}
|
|
64
|
-
{% if not params.
|
|
64
|
+
{% if not params.variant or params.variant == "branded" or params.variant == "info" or params.variant == "bare" %}
|
|
65
65
|
<span class="ons-panel__assistive-text ons-u-vh">{{ params.assistiveTextPrefix | default("Important information: ") }}</span>
|
|
66
|
-
{% elif params.
|
|
67
|
-
{% set defaultText = "Completed" if params.
|
|
68
|
-
<span{% if params.
|
|
66
|
+
{% elif params.variant == 'error' or params.variant == 'success' %}
|
|
67
|
+
{% set defaultText = "Completed" if params.variant == "success" else "Error" %}
|
|
68
|
+
<span{% if params.variant == "success" %} id="alert"{% endif %} class="ons-panel__assistive-text ons-u-vh">{{ params.assistiveTextPrefix | default(defaultText ~ ": ") }}</span>
|
|
69
69
|
{% endif %}
|
|
70
70
|
{% endif %}
|
|
71
71
|
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
88
|
|
|
89
|
-
{% if params.
|
|
89
|
+
{% if params.variant == "warn-branded" or params.variant == "announcement" %}
|
|
90
90
|
</div>
|
|
91
91
|
</div>
|
|
92
92
|
{% endif %}
|