mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
Fix mis-spelling of aria-describedby
This is currently spelt incorrectly though it seemed to work nonetheless. Can only assume this is a common error, for this attribute or all attribute names, so browsers work it out. This makes the spelling match the spec: https://www.w3.org/TR/wai-aria/#aria-describedby
This commit is contained in:
@@ -49,11 +49,11 @@
|
|||||||
|
|
||||||
this.$textbox
|
this.$textbox
|
||||||
.attr(
|
.attr(
|
||||||
'aria-described-by',
|
'aria-describedby',
|
||||||
(
|
(
|
||||||
this.$textbox.attr('aria-described-by') || ''
|
this.$textbox.attr('aria-describedby') || ''
|
||||||
) + (
|
) + (
|
||||||
this.$textbox.attr('aria-described-by') ? ' ' : ''
|
this.$textbox.attr('aria-describedby') ? ' ' : ''
|
||||||
) + id
|
) + id
|
||||||
)
|
)
|
||||||
.on('input', throttle(this.update, 150))
|
.on('input', throttle(this.update, 150))
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ describe('Update content', () => {
|
|||||||
<input type="hidden" name="csrf_token" value="abc123" />
|
<input type="hidden" name="csrf_token" value="abc123" />
|
||||||
<label for="template_content" id="template-content-label">Template content<label>
|
<label for="template_content" id="template-content-label">Template content<label>
|
||||||
<span id="example-hint-text">Example hint text</span>
|
<span id="example-hint-text">Example hint text</span>
|
||||||
<textarea name="template_content" id="template_content" aria-described-by="example-hint-text">Content of message</textarea>
|
<textarea name="template_content" id="template_content" aria-describedby="example-hint-text">Content of message</textarea>
|
||||||
</form>
|
</form>
|
||||||
<div data-module="update-status" data-updates-url="${updatesURL}" data-target="template_content">
|
<div data-module="update-status" data-updates-url="${updatesURL}" data-target="template_content">
|
||||||
Initial content
|
Initial content
|
||||||
@@ -78,21 +78,21 @@ describe('Update content', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
document.getElementById('template_content').getAttribute('aria-described-by')
|
document.getElementById('template_content').getAttribute('aria-describedby')
|
||||||
).toEqual(
|
).toEqual(
|
||||||
"example-hint-text update-status"
|
"example-hint-text update-status"
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("It should handle a textarea without an aria-described-by attribute", () => {
|
test("It should handle a textarea without an aria-describedby attribute", () => {
|
||||||
|
|
||||||
document.getElementById('template_content').removeAttribute('aria-described-by');
|
document.getElementById('template_content').removeAttribute('aria-describedby');
|
||||||
|
|
||||||
window.GOVUK.modules.start();
|
window.GOVUK.modules.start();
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
document.getElementById('template_content').getAttribute('aria-described-by')
|
document.getElementById('template_content').getAttribute('aria-describedby')
|
||||||
).toEqual(
|
).toEqual(
|
||||||
"update-status"
|
"update-status"
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user