Skip to content

test : added unit tests for ScrollToBottom component - #4

Open
tmdeveloper007 wants to merge 2 commits into
mainfrom
#8419
Open

tmdeveloper007 wants to merge 2 commits into
mainfrom
#8419

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Owner

Summary of What Has Been Done

Created components/ScrollToBottom.test.tsx with unit tests covering:

  • Correct aria-label on the button ("Scroll to bottom")
  • Button is visible when scrolled near the top of the page
  • Button scrolls to document bottom when clicked (calls window.scrollTo)
  • Scroll target uses scrollHeight as the top value
  • Fixed positioning and icon rendering

Mocked all framer-motion hooks (useScroll, useSpring, useTransform, useReducedMotion, AnimatePresence, motion.div, motion.circle) to prevent rendering dependencies on animation libraries.

Changes Made

  • New file: components/ScrollToBottom.test.tsx

Impact it Made

Adds first unit test coverage for the ScrollToBottom component, ensuring the scroll-to-bottom navigation button correctly targets the document bottom.

Closes #8419.

Note: please assign this PR to the tmdeveloper007 account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant