Commit 665bc25d authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Add aria-pressed attribute to highlights toggle

parent aa7aa7a6
...@@ -181,7 +181,7 @@ export default function Toolbar({ ...@@ -181,7 +181,7 @@ export default function Toolbar({
<ToolbarButton <ToolbarButton
title="Show highlights" title="Show highlights"
icon={showHighlights ? ShowIcon : HideIcon} icon={showHighlights ? ShowIcon : HideIcon}
selected={showHighlights} pressed={showHighlights}
onClick={toggleHighlights} onClick={toggleHighlights}
/> />
<ToolbarButton <ToolbarButton
......
...@@ -91,6 +91,15 @@ describe('Toolbar', () => { ...@@ -91,6 +91,15 @@ describe('Toolbar', () => {
assert.equal(statusEl.text(), 'Highlights visible'); assert.equal(statusEl.text(), 'Highlights visible');
}); });
[true, false].forEach(showHighlights => {
it('sets props in highlights toggle', () => {
const wrapper = createToolbar({ showHighlights });
const highlightsButton = findButton(wrapper, 'Show highlights');
assert.equal(highlightsButton.prop('aria-pressed'), showHighlights);
});
});
it( it(
'should pass a11y checks', 'should pass a11y checks',
checkAccessibility([ checkAccessibility([
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment