diff --git a/src/components/List/ListAccordionGroup.tsx b/src/components/List/ListAccordionGroup.tsx index 15e148ae6e..f153eb557f 100644 --- a/src/components/List/ListAccordionGroup.tsx +++ b/src/components/List/ListAccordionGroup.tsx @@ -74,7 +74,7 @@ const ListAccordionGroup = ({ return ( diff --git a/src/components/__tests__/ListAccordion.test.tsx b/src/components/__tests__/ListAccordion.test.tsx index 0c24538348..d9be0ec25a 100644 --- a/src/components/__tests__/ListAccordion.test.tsx +++ b/src/components/__tests__/ListAccordion.test.tsx @@ -100,6 +100,22 @@ describe('ListAccordion', () => { ); }); + it('expands the accordion with id={0} when it is the controlled expandedId', () => { + const { getByText, queryByText } = render( + {}}> + + + + + + + + ); + + expect(getByText('First accordion item')).toBeTruthy(); + expect(queryByText('Second accordion item')).toBeNull(); + }); + it('should throw an error when id={""}', () => { const ListAccordionTest = () => (