From 6bff93b518299eb9a22ca4e4bbd215a2d3e736aa Mon Sep 17 00:00:00 2001 From: storywithoutend Date: Wed, 28 Aug 2024 20:16:30 +0800 Subject: [PATCH] fix scrollbox intersectional observer --- .../src/components/atoms/ScrollBox/ScrollBox.test.tsx | 6 +++--- components/src/components/atoms/ScrollBox/ScrollBox.tsx | 1 + components/src/components/atoms/ScrollBox/styles.css.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/src/components/atoms/ScrollBox/ScrollBox.test.tsx b/components/src/components/atoms/ScrollBox/ScrollBox.test.tsx index 6f7bae0b..80a9d30c 100644 --- a/components/src/components/atoms/ScrollBox/ScrollBox.test.tsx +++ b/components/src/components/atoms/ScrollBox/ScrollBox.test.tsx @@ -64,13 +64,13 @@ describe('', () => { mockIntersectionObserver(true, false) render() }) - it.skip('should only show top line when intersecting with bottom', () => { + it('should only show top line when intersecting with bottom', () => { mockIntersectionObserver(false, true) render() expectLine('top', true) expectLine('bottom', false) }) - it.skip('should show both lines neither intersecting', () => { + it('should show both lines neither intersecting', () => { mockIntersectionObserver(false, false) render() expectLine('top', true) @@ -116,7 +116,7 @@ describe('', () => { expectLine('top', false) expectLine('bottom', false) }) - it.skip('should fire callback on intersection', () => { + it('should fire callback on intersection', () => { mockIntersectionObserver(true, false) const onReachedTop = vi.fn() render() diff --git a/components/src/components/atoms/ScrollBox/ScrollBox.tsx b/components/src/components/atoms/ScrollBox/ScrollBox.tsx index a4b92ee7..2be27498 100644 --- a/components/src/components/atoms/ScrollBox/ScrollBox.tsx +++ b/components/src/components/atoms/ScrollBox/ScrollBox.tsx @@ -167,6 +167,7 @@ export const ScrollBox = ({ } : {} } + ref={ref} >