Skip to content

Commit

Permalink
fix scrollbox intersectional observer
Browse files Browse the repository at this point in the history
  • Loading branch information
storywithoutend committed Aug 28, 2024
1 parent fd4e19b commit 6bff93b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/src/components/atoms/ScrollBox/ScrollBox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ describe('<ScrollBox />', () => {
mockIntersectionObserver(true, false)
render(<Component />)
})
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(<Component />)
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(<Component />)
expectLine('top', true)
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('<ScrollBox />', () => {
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(<Component onReachedTop={onReachedTop} />)
Expand Down
1 change: 1 addition & 0 deletions components/src/components/atoms/ScrollBox/ScrollBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export const ScrollBox = ({
}
: {}
}
ref={ref}
>
<Box
data-testid="scrollbox-top-intersect"
Expand Down
2 changes: 1 addition & 1 deletion components/src/components/atoms/ScrollBox/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const scrollBox = style({
'&::-webkit-scrollbar-thumb': {
transition: 'box-shadow 0.15s ease-in-out',
boxShadow: `inset 0 0 ${commonVars.space['3']} ${commonVars.space['3']} ${modeVars.color.greyLight}`,
border: 'solid $1 transparent',
border: `solid ${commonVars.space['1']} transparent`,
borderRadius: commonVars.space['3'],
backgroundColor: 'transparent',
},
Expand Down

0 comments on commit 6bff93b

Please sign in to comment.