Commit 53a1c634 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Use boolean values for aria-selected in JSX

parent 45a2719f
......@@ -72,7 +72,7 @@ export default function AutocompleteList<Item>({
<li
key={`AutocompleteList-${index}`}
role="option"
aria-selected={(activeItem === index).toString()}
aria-selected={activeItem === index}
className={classnames(
'flex items-center',
'border-l-4 py-1 px-3 cursor-pointer hover:bg-grey-2',
......
......@@ -54,8 +54,8 @@ describe('AutocompleteList', () => {
it('sets `aria-selected` on the <li> at the matching index to `activeItem`', () => {
const wrapper = createComponent({ open: true, activeItem: 0 });
assert.equal(wrapper.find('li').at(0).prop('aria-selected'), 'true');
assert.equal(wrapper.find('li').at(1).prop('aria-selected'), 'false');
assert.equal(wrapper.find('li').at(0).prop('aria-selected'), true);
assert.equal(wrapper.find('li').at(1).prop('aria-selected'), false);
});
it('calls `onSelect` when an <li> is clicked with the corresponding item', () => {
......
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