Add expanded semantics to radioSelect buttons

All buttons that open or close a region of the
component should have aria-expanded attributes to
show:
- they have that control
- the state of the region
This commit is contained in:
Tom Byers
2021-01-19 14:09:51 +00:00
parent 81b576acad
commit e7291ffd51
2 changed files with 12 additions and 3 deletions

View File

@@ -179,6 +179,14 @@ describe('RadioSelect', () => {
});
test("each button's semantics should show it controls another region and that region is collapsed", () => {
categoryButtons.forEach(btn => {
expect(btn.getAttribute('aria-expanded')).toEqual('false');
});
});
});
});
@@ -241,6 +249,7 @@ describe('RadioSelect', () => {
expect(button).not.toBeNull();
expect(button.getAttribute('value')).toEqual('Done');
expect(button.getAttribute('aria-expanded')).toEqual('true');
});