Madalyn Parker
@madalynrose
Frontend Developer
Mental Health Advocate
Web a11y
Disclaimer: NOT an expert
Coffee drinker
Rabbit owner
@madalynrose
@madalynrose
@madalynrose
@madalynrose
@madalynrose
@madalynrose
@madalynrose
@madalynrose
Start Small
What could benefit the most?
What has the furthest reach?
@madalynrose
@madalynrose
@madalynrose
They need to know the chat box is there.
They need to know whether a person is available to chat or not.
They need to see the call to action text.
They need to know which messages in the chat belong to whom.
They need to know when messages come in and what they say.
They need to be able to end the chat.
They need to be able to request a transcript of the chat.
They need to be able to leave feedback about their chat.
They need to be able to upload files.
@madalynrose
@madalynrose
@madalynrose
@madalynrose
@madalynrose
@madalynrose
assert = require('assert')
React = require('react')
{ shallow } = require('enzyme')
ImageComponent = require('../src/myProject/components/ImageComponent.cjsx')
/*
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'
wrapper = shallow(<ImageComponent url={url} altText="my awesome picture"/>)
//assert passes axe-core audit
@madalynrose
@madalynrose
jsdom = require('jsdom').jsdom
module.exports = class DOMContext
constructor: ->
@document = jsdom('')
getDocument: ->
return @document
getWindow: ->
return @document.defaultView
destroy: ->
@getWindow().close()
@madalynrose
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
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 }
testRawComponent: (component) =>
mounted = @mountForA11yTest(component)
return @testMountedComponent(mounted.wrapper)
.then(() =>
@cleanUpA11yMount(mounted.div, mounted.dom)
)
testMountedComponent: (wrapper) =>
node = findDOMNode(wrapper.component)
return @runAudit(node, {})
@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
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
@madalynrose