Open jessebeach opened 9 years ago
In the Mocha test file, you get access to the client
and the test results from Quail.
Presumably, we need to then
client
to trigger focus on each oneJesse, are you sure we need all of this? Calling DOM focus()
method will in fact apply CSS properly, and the CSS can be retreived e.g. with getComputedStyle
. You might check it at focus()
+ getComputedStyle()
demo.
Adding an extra states like peding, will add more complexity to this solution, while we can stick to vanilla JS.
haha!
So, this is really silly. Thanks for calling this out. What I was doing, was calling $0.focus()
on elements from the Inspector...BUT...if the inspector has focus, then nothing in the page has focus. So calling focus
from the inspector, although it sets document.activeElement
doesn't appear to change the styling.
I set up a call to focus in setTimeout
then moved focus to the page. Sure enough, the styling is triggered on Focus.
Derp derp derp.
Cool! And you're right, browsers do drop focus presentation the moment you minimize the browser. That makes integration tests for JS so much more painful. :)
Reenable the
focusIndicatorVisible
test in the master branch.https://github.com/quailjs/quail/blob/master/lib/assessments/focusIndicatorVisible.js
!! Important !!
You'll need to go into
tests.yml
and uncomment thefocusIndicatorVisible
test, then rebuild quail in order for this assessment to be available. Run:in the CLI, and you're off to the races.