Madalyn Parker
@madalynrose
Β
@madalynrose
@madalynrose
β¨RULESβ¨
@madalynrose
@madalynrose
What is small enough for me to cover?Β
What could benefit the most?
What has the furthest reach?
Β
@madalynrose
@madalynrose
@madalynrose
@marcysutton
@madalynrose
@madalynrose
using axe.run
@madalynrose
//mount component properly
mountForA11yTest: (component) =>
dom = new DOMContext()
doc = dom.getDocument()
div = doc.createElement('div')
doc.body.appendChild(div)
wrapper = mount(component, { attachTo: div })
return { wrapper: wrapper, div: div, dom: dom }
//clean up after ourselves
cleanUpA11yMount: (div, dom) =>
dom.getDocument().body.removeChild(div)
dom.destroy()
@madalynrose
runAudit: (node, config) =>
oldNode = global.Node
global.Node = node.ownerDocument.defaultView.Node
return new Promise((resolve, reject) =>
axeCore.run(node, config, (err, results) =>
global.Node = oldNode
if err
reject(err)
else
try
assert.equal AxeCoreResults.hasViolations(results), false
assert.equal AxeCoreResults.getViolationsList(results).length, 0
resolve()
catch e
reject(e)
)
)
@madalynrose
/*
ImageComponent = ({ url, altText }) ->
<img src={url} alt={altText} />
*/
describe '<ImageComponent />', =>
it 'should have no accessibility errors', ->
url = 'https://mywebsite.com/some/path/to/an/image.jpg'
//return passesA11yTest(<ImageComponent url={url} altText={""}/>
@madalynrose
@madalynrose
@madalynrose
@madalynrose
@madalynrose
π
@madalynrose
π
π²
π²
π²
@madalynrose
@madalynrose
π
π
π
@madalynrose
π²
π
π
π
π²
π²
π²
π²
@madalynrose
π²
π
π
π
π²
π²
π²
π²
π²
π²
π²
π²
@madalynrose
@madalynrose
π
π
π
@madalynrose
π
π
π
π²
π²
π²
π²
π²
π²
π²
π²
@madalynrose
@madalynrose
π
π
π
@madalynrose
π
π
π
π²
@madalynrose
@madalynrose
@madalynrose
@madalynrose
@madalynrose
@madalynrose
<div
aria-live="assertive"
aria-atomic="true"
role="alert"
id={id}
style={defaultStyles}>
<p>{text}</p>
</div>
defaultStyles = {
position: 'absolute',
visibility: 'visible',
overflow: 'hidden',
display: 'block',
width: '1px',
height: '1px',
margin: '-1px',
border: '0',
padding: '0',
clip: 'rect(0px, 0px, 0px, 0px)',
clipPath: 'polygon(0px 0px, 0px 0px, 0px 0px, 0px 0px)',
whiteSpace: 'nowrap'
}
@madalynrose
control region changes in state based on chat box focus
if(chat box is focused)
add event to list of announcements
join list of announcements with periods
dump list of announcements into announcer
else
# chat box will already play a notification
# sound if it is not focused
add event to list of announcements
@madalynrose
@madalynrose
π RULES π
@madalynrose
π USABILITY π
@madalynrose
π USABILITY π
@madalynrose
@madalynrose
https://slides.com/madalynrose/axe/
@madalynrose