Spin-off from #2996404-3: Replace old keypress workaround in AjaxFormImageButtonTest.
Problem/Motivation
AjaxFormImageButtonTest
has a test to assert that ajax-enabled buttons are keyboard operable, by pressing the ENTER key when focussed. However buttons are expected to respond when either the enter OR spacebar key is pressed. Let's cover this situation too.
It's common to see faux-buttons like this in the wild:
<a href="#" role="button" onclick="foo()">Edit</a>
The button role tells screen readers to announce it as a button, yet it doesn't behave like a button because it can't be activated by the space key. That's a bug we can guard against by testing both keys.
Proposed resolution
Replicate the ENTER key press test in AjaxFormImageButtonTest
, so we are testing the desired SPACE key behaviour too.
Remaining tasks
Patch for AjaxFormImageButtonTest
.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3030363-2.patch | 1.11 KB | andrewmacpherson |
Comments
Comment #2
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedComment #3
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedcorrect key in title.
Comment #5
Krzysztof DomańskiCan we join both tests to improve test performance?
Comment #6
Krzysztof DomańskiWithout the previous one this looks good.
Comment #9
lauriiiCommitted 9a3477e and pushed to 8.8.x. Since this changes only tests, also cherry-picked to 8.7.x. Thanks!