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 ce387e343a..4d594e7bd0 100644 --- a/src/components/__tests__/ListAccordion.test.tsx +++ b/src/components/__tests__/ListAccordion.test.tsx @@ -135,6 +135,22 @@ describe('ListAccordion', () => { await expect(render()).resolves.toBeDefined(); }); + it('expands the accordion with id={0} when it is the controlled expandedId', async () => { + await render( + {}}> + + + + + + + + ); + + expect(screen.getByText('First accordion item')).toBeOnTheScreen(); + expect(screen.queryByText('Second accordion item')).not.toBeOnTheScreen(); + }); + it('should throw an error when id={""}', async () => { const ListAccordionTest = () => (