From 376f811924c9f36f8e9d77f3a6a5c48dbac17c57 Mon Sep 17 00:00:00 2001 From: Ivan Popov <87794607+qoudo@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:06:44 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=D1=81=D1=8F=20=D0=BE=D1=82=20=D0=BF=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=BA=D0=B8=20=D0=B4=D0=BE=D1=87=D0=B5=D1=80=D0=BD?= =?UTF-8?q?=D0=B8=D1=85=20=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B2=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D0=B8=D0=B2=D0=BD=D0=BE=D0=BC=20=D0=B8=D0=B7=D0=BE=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B8=20(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #299 Избавиться от проверки дочерних элементов в интерактивном изображении --- .../__test__/interactive-image.test.tsx | 15 +++++++++++++++ .../interactive-image/interactive-image.tsx | 6 +----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/common/components/interactive-image/__test__/interactive-image.test.tsx b/src/common/components/interactive-image/__test__/interactive-image.test.tsx index 5c4466f1..2b50aef5 100644 --- a/src/common/components/interactive-image/__test__/interactive-image.test.tsx +++ b/src/common/components/interactive-image/__test__/interactive-image.test.tsx @@ -84,4 +84,19 @@ describe('InteractiveImage', () => { ); }).toThrow(); }); + + it('should render points in the wrapper', () => { + const { queryAllByTestId } = render( + + +
+ +
+
, + ); + + expect(queryAllByTestId('interactive-image:image')).toHaveLength(1); + expect(queryAllByTestId('wrapper')).toHaveLength(1); + expect(queryAllByTestId('interactive-image:point')).toHaveLength(1); + }); }); diff --git a/src/common/components/interactive-image/interactive-image.tsx b/src/common/components/interactive-image/interactive-image.tsx index 08a64bb5..7234c10b 100644 --- a/src/common/components/interactive-image/interactive-image.tsx +++ b/src/common/components/interactive-image/interactive-image.tsx @@ -23,11 +23,7 @@ export const InteractiveImage = forwardRef - {Children.toArray(children).filter( - child => - isValidElement(child) && - (child.type === ImageAnchor || child.type === Image || child.type === Point), - )} + {Children.toArray(children).filter(child => isValidElement(child))} ); },