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({
<ToolbarButton
title="Show highlights"
icon={showHighlights ? ShowIcon : HideIcon}
selected={showHighlights}
pressed={showHighlights}
onClick={toggleHighlights}
/>
<ToolbarButton
......
......@@ -91,6 +91,15 @@ describe('Toolbar', () => {
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(
'should pass a11y checks',
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