Skip to content

implemented - #610

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
Stellar-Land:wandoo
Jul 26, 2026
Merged

implemented#610
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
Stellar-Land:wandoo

Conversation

@wandooadzer-cmyk

Copy link
Copy Markdown
Contributor

Summary

File: src/hooks/__tests__/useInfiniteScroll.test.tsx

Tests:

  1. Callback fires on intersection — confirms onLoadMore is called when the sentinel element intersects
  2. Callback does not fire when not intersecting — confirms onLoadMore is NOT called when the element is out of view
  3. Observer disconnected on unmount — confirms disconnect() is called when the component unmounts
  4. Observer not created when enabled: false — confirms no observer is created when the hook is disabled
  5. Observer not created when hasMore: false — bonus: also covers the hasMore guard

The mock uses a class-based IntersectionObserver replacement that captures callbacks, allowing tests to manually simulate intersection events. The root cause of the initial failures was a JSX gotcha: bare attribute shorthand onLoadMore was interpreted as onLoadMore={true}, which broke the ref.

Testing

  • pnpm lint
  • pnpm build

Checklist

@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@wandooadzer-cmyk Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit c6125ca into accesslayerorg:dev Jul 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants