Skip to content

Commit

Permalink
fix(accordion): fix unit test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrds committed Jun 11, 2021
1 parent a176453 commit 00e8e26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/accordion/accordion.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const Accordion = React.forwardRef(

const observer = useRef(
new ResizeObserver(() => {
/* istanbul ignore else */
if (accordionContent.current) {
setContentHeight(accordionContent.current.scrollHeight);
}
Expand All @@ -73,7 +74,7 @@ const Accordion = React.forwardRef(
useEffect(() => {
const observerRef = observer.current;
const referenceRef = accordionContent.current;
observer.current.observe(referenceRef);
observerRef.observe(referenceRef);

return () => {
observerRef.unobserve(referenceRef);
Expand Down

0 comments on commit 00e8e26

Please sign in to comment.