test(e2e): add exported-page a11y smoke (focus outline, skip-link tab order) #4
@@ -282,6 +282,17 @@ function buildJs() {
|
||||
(function(){
|
||||
var ts = document.querySelector('input[name="_ts"]');
|
||||
if(ts){ ts.value = String(Date.now()); }
|
||||
// Ensure skip-link moves focus into main for a11y
|
||||
var skip = document.querySelector('a.skip-link');
|
||||
var main = document.getElementById('main');
|
||||
if (skip && main) {
|
||||
skip.addEventListener('click', function(){
|
||||
if (!main.hasAttribute('tabindex')) {
|
||||
main.setAttribute('tabindex', '-1');
|
||||
}
|
||||
main.focus();
|
||||
});
|
||||
}
|
||||
})();
|
||||
`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user