From ea101845d19befc44a68d5e64e9c8fd7c8ecdd4f Mon Sep 17 00:00:00 2001 From: storywithoutend Date: Wed, 15 May 2024 18:03:07 +0800 Subject: [PATCH] fix scrollbox unit test --- .../src/components/atoms/ScrollBox/ScrollBox.test.tsx | 2 +- components/src/components/atoms/ScrollBox/ScrollBox.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/src/components/atoms/ScrollBox/ScrollBox.test.tsx b/components/src/components/atoms/ScrollBox/ScrollBox.test.tsx index a5eccb2f..f04e88e2 100644 --- a/components/src/components/atoms/ScrollBox/ScrollBox.test.tsx +++ b/components/src/components/atoms/ScrollBox/ScrollBox.test.tsx @@ -44,7 +44,7 @@ const mockIntersectionObserver = makeMockIntersectionObserver( ) const expectLine = (e: 'top' | 'bottom', visible: boolean) => - expect(screen.getByTestId('scroll-box')).toHaveAttribute( + expect(screen.getByTestId(`scrollbox-${e}-line`)).toHaveAttribute( `data-${e}-line`, visible ? 'true' : 'false', ) diff --git a/components/src/components/atoms/ScrollBox/ScrollBox.tsx b/components/src/components/atoms/ScrollBox/ScrollBox.tsx index 2401cd56..58196b8c 100644 --- a/components/src/components/atoms/ScrollBox/ScrollBox.tsx +++ b/components/src/components/atoms/ScrollBox/ScrollBox.tsx @@ -219,10 +219,15 @@ export const ScrollBox = ({ ref={bottomRef} /> - + )